]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: drop duplicated variable
authorKefu Chai <kchai@redhat.com>
Sun, 3 Jan 2021 17:28:23 +0000 (01:28 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 3 Jan 2021 17:34:46 +0000 (01:34 +0800)
not_arch_x32 replicates ${_support_x64}. and a variable starts with
"not" is just difficult to parse. so drop it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/CheckNasm.cmake

index 32e0085c97801210b9c27b2322884187042dc2af..8ec728edc2fd8f69fc937c64e75dfef40c82adba 100644 (file)
@@ -14,10 +14,9 @@ macro(check_nasm_support _object_format _support_x64 _support_x64_and_avx2 _supp
       #error x32
       #endif
       int main() {}
-      " not_arch_x32)
+      " ${_support_x64})
       set(CMAKE_REQUIRED_QUIET ${save_quiet})
-      if(not_arch_x32)
-        set(${_support_x64} TRUE)
+      if(${_support_x64})
         execute_process(COMMAND nasm -f ${object_format} -i
           ${CMAKE_SOURCE_DIR}/src/isa-l/include/
           ${CMAKE_SOURCE_DIR}/src/isa-l/erasure_code/gf_vect_dot_prod_avx2.asm
@@ -38,12 +37,12 @@ macro(check_nasm_support _object_format _support_x64 _support_x64_and_avx2 _supp
         if(NOT rt)
           set(${_support_x64_and_avx512} TRUE)
         endif(NOT rt)
-      endif(not_arch_x32)
+      endif(${_support_x64})
     endif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
   endif(NOT no_nasm)
   if(no_nasm)
     message(STATUS "Could NOT find nasm")
-  elseif(NOT not_arch_x32)
+  elseif(NOT ${_support_x64})
     message(STATUS "Found nasm: but x86_64 with x32 ABI is not supported")
   endif()
   if(${_support_x64_and_avx512})