Skip to content

Commit c131f98

Browse files
iboBDiamonDinoia
authored andcommitted
cmake: proper check for msvc, proper name of msvc arch check
1 parent 78f2f05 commit c131f98

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmake/toolchain.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ if(FINUFFT_ARCH_FLAGS STREQUAL "native")
6464
set(FINUFFT_ARCH_FLAGS -mtune=native CACHE STRING "" FORCE)
6565
filter_supported_compiler_flags(FINUFFT_ARCH_FLAGS FINUFFT_ARCH_FLAGS)
6666
endif()
67-
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
67+
if(MSVC)
6868
# -march=native emulation for MSVC
69-
check_arch_support()
69+
check_msvc_arch_support()
7070
endif()
7171
if(NOT FINUFFT_ARCH_FLAGS)
7272
message(WARNING "No architecture flags are supported by the compiler.")

cmake/utils.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function(filter_supported_compiler_flags input_flags_var output_flags_var)
3535
set(${output_flags_var} ${supported_flags} PARENT_SCOPE)
3636
endfunction()
3737

38-
function(check_arch_support)
38+
function(check_msvc_arch_support)
3939
message(STATUS "Checking for AVX, AVX512 and SSE support")
4040
try_run(
4141
RUN_RESULT_VAR
@@ -97,7 +97,7 @@ endif()
9797

9898
function(enable_asan target)
9999
target_compile_options(${target} PRIVATE ${FINUFFT_SANITIZER_FLAGS})
100-
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
100+
if(NOT MSVC)
101101
target_link_options(${target} PRIVATE ${FINUFFT_SANITIZER_FLAGS})
102102
endif()
103103
endfunction()

0 commit comments

Comments
 (0)