File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -211,10 +211,13 @@ elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR CMAKE_GENERATOR_PLATFORM_LW
211211    endif ()
212212elseif  (${CMAKE_SYSTEM_PROCESSOR}  MATCHES  "ppc64" )
213213    message (STATUS  "PowerPC detected" )
214-     execute_process (COMMAND  bash -c "grep POWER10 /proc/cpuinfo | head -n 1" 
215-                    OUTPUT_VARIABLE  POWER10_M)
216-     string (FIND  ${POWER10_M}  "POWER10"  substring_index)
217-     if (${substring_index}  GREATER_EQUAL  0)
214+     execute_process (COMMAND  bash -c "grep POWER10 /proc/cpuinfo | head -n 1"  OUTPUT_VARIABLE  POWER10_M)
215+     string (FIND  "${POWER10_M} "  "POWER10"  substring_index)
216+     if  (NOT  DEFINED  substring_index OR  "${substring_index} "  STREQUAL  "" )
217+         set (substring_index -1)
218+     endif ()
219+ 
220+     if  (${substring_index}  GREATER_EQUAL  0)
218221       list (APPEND  ARCH_FLAGS -mcpu=power10)
219222    elseif  (${CMAKE_SYSTEM_PROCESSOR}  MATCHES  "ppc64le" )
220223       list (APPEND  ARCH_FLAGS -mcpu=powerpc64le)
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments