Skip to content

Commit 4dfa298

Browse files
committed
mpopcnt just for cpp
1 parent 58160a7 commit 4dfa298

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,12 @@ if (NOT HIGHS_COVERAGE AND NOT APPLE)
401401
check_cxx_compiler_flag("-mpopcntd" COMPILER_SUPPORTS_POPCNTD)
402402
if(COMPILER_SUPPORTS_POPCNTD)
403403
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcntd")
404+
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mpopcntd>")
404405
endif()
405406
else()
406407
check_cxx_compiler_flag("-mpopcnt" COMPILER_SUPPORTS_POPCNT)
407408
if(COMPILER_SUPPORTS_POPCNT)
408-
add_compile_options(-mpopcnt)
409+
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mpopcnt>")
409410
endif()
410411
endif()
411412
endif()

0 commit comments

Comments
 (0)