Skip to content

Commit 0640094

Browse files
traversaronim65s
authored andcommitted
Only add GCC Clang warnings options in GCC/Clang
1 parent 2d48bc9 commit 0640094

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ set(TESTS eiquadprog-basic eiquadprog-fast eiquadprog-rt eiquadprog-both
2424
foreach(test ${TESTS})
2525
add_unit_test(${test} ${test}.cpp)
2626
target_link_libraries(${test} ${PROJECT_NAME} Boost::unit_test_framework)
27-
target_compile_options(
28-
${test} PRIVATE "-Wno-sign-conversion") # We have a lot of implicit size_t
29-
# to Eigen::Index conversions
27+
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
28+
target_compile_options(
29+
${test} PRIVATE "-Wno-sign-conversion") # We have a lot of implicit size_t
30+
# to Eigen::Index conversions
31+
endif()
3032
endforeach(test ${TESTS})
3133

3234
add_library(testab SHARED TestA.cpp TestB.cpp)
3335
target_link_libraries(testab ${PROJECT_NAME})
3436
target_link_libraries(test-integration testab)
35-
target_compile_options(
36-
testab PRIVATE "-Wno-sign-conversion") # We have a lot of implicit size_t to
37-
# Eigen::Index conversions
37+
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
38+
target_compile_options(
39+
testab PRIVATE "-Wno-sign-conversion") # We have a lot of implicit size_t to
40+
# Eigen::Index conversions
41+
endif()

0 commit comments

Comments
 (0)