[CMAKE] Some options are only supported by GCC, don't use them for clang
authorVictor Perevertkin <victor.perevertkin@reactos.org>
Fri, 9 Apr 2021 00:58:19 +0000 (03:58 +0300)
committerVictor Perevertkin <victor.perevertkin@reactos.org>
Fri, 9 Apr 2021 00:58:19 +0000 (03:58 +0300)
These are (so far):
-Wno-format-overflow
-Wno-nonnull-compare
-Wno-old-style-declaration
-Wno-unused-but-set-variable

35 files changed:
base/applications/network/telnet/CMakeLists.txt
base/services/tftpd/CMakeLists.txt
dll/3rdparty/libtiff/CMakeLists.txt
dll/directx/wine/wined3d/CMakeLists.txt
dll/opengl/glu32/CMakeLists.txt
dll/win32/browseui/CMakeLists.txt
dll/win32/browseui/shellbars/CMakeLists.txt
dll/win32/browseui/shellfind/CMakeLists.txt
dll/win32/winmm/CMakeLists.txt
drivers/bluetooth/fbtusb/CMakeLists.txt
drivers/filesystems/ext2/CMakeLists.txt
drivers/filesystems/ffs/CMakeLists.txt
drivers/filesystems/reiserfs/CMakeLists.txt
drivers/filesystems/udfs/CMakeLists.txt
drivers/network/dd/netkvm/CMakeLists.txt
drivers/storage/class/classpnp/CMakeLists.txt
drivers/storage/class/disk_new/CMakeLists.txt
drivers/storage/ide/uniata/CMakeLists.txt
modules/rosapps/applications/devutils/symdump/CMakeLists.txt
modules/rosapps/applications/net/ncftp/CMakeLists.txt
modules/rosapps/applications/sysutils/logevent/CMakeLists.txt
modules/rosapps/applications/sysutils/pedump/CMakeLists.txt
modules/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt
modules/rosapps/templates/dialog/CMakeLists.txt
modules/rostests/winetests/advpack/CMakeLists.txt
modules/rostests/winetests/fusion/CMakeLists.txt
modules/rostests/winetests/msi/CMakeLists.txt
modules/rostests/winetests/ole32/CMakeLists.txt
modules/rostests/winetests/services/CMakeLists.txt
modules/rostests/winetests/setupapi/CMakeLists.txt
modules/rostests/winetests/shell32/CMakeLists.txt
modules/rostests/winetests/user32/CMakeLists.txt
modules/rostests/winetests/version/CMakeLists.txt
sdk/lib/3rdparty/adns/CMakeLists.txt
sdk/lib/3rdparty/cardlib/CMakeLists.txt

index d77a95c..7bb174f 100644 (file)
@@ -24,10 +24,15 @@ list(APPEND SOURCE
 add_executable(telnet ${SOURCE} telnet.rc)
 target_link_libraries(telnet cppstl)
 set_target_cpp_properties(telnet WITH_EXCEPTIONS)
+
 if (NOT MSVC)
-    target_compile_options(telnet PRIVATE -Wno-restrict $<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>)
     target_compile_definitions(telnet PRIVATE _CRT_NONSTDC_NO_DEPRECATE)
 endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(telnet PRIVATE -Wno-restrict $<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>)
+endif()
+
 set_module_type(telnet win32cui)
 add_importlibs(telnet ws2_32 user32 msvcrt kernel32 ntdll)
 add_pch(telnet precomp.h SOURCE)
index 1b10567..1790a81 100644 (file)
@@ -4,6 +4,6 @@ set_module_type(tftpd win32cui)
 add_importlibs(tftpd advapi32 ws2_32 iphlpapi msvcrt kernel32)
 add_cd_file(TARGET tftpd DESTINATION reactos/system32 FOR all)
 
-if(GCC OR CLANG)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(tftpd PRIVATE -Wno-format-overflow)
 endif()
index fc98c11..f7c0b90 100644 (file)
@@ -67,6 +67,8 @@ if(MSVC)
     remove_target_compile_option(libtiff "/we4311")
     # error C4312: 'type cast': conversion from 'int' to 'thandle_t' of greater size
     remove_target_compile_option(libtiff "/we4312")
-else()
-    target_compile_options(libtiff PRIVATE "-Wno-unused-but-set-variable")
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(libtiff PRIVATE -Wno-unused-but-set-variable)
 endif()
index 3af303f..10f144b 100644 (file)
@@ -53,6 +53,6 @@ add_importlibs(d3dwine user32 opengl32 gdi32 advapi32 msvcrt kernel32 ntdll)
 add_pch(d3dwine precomp.h SOURCE)
 add_cd_file(TARGET d3dwine DESTINATION reactos/system32 FOR all)
 
-if(NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(d3dwine PRIVATE -Wno-format-overflow)
 endif()
index 490732e..ffa8a54 100644 (file)
@@ -121,14 +121,18 @@ target_link_libraries(glu32 cpprt)
 set_module_type(glu32 win32dll)
 
 if(NOT MSVC)
-    target_compile_options(glu32 PRIVATE -Wno-write-strings -Wno-unused-but-set-variable)
-    # Prevent a warning when comparing 'this' against 0
-    set_source_files_properties(src/libnurbs/internals/arc.cc PROPERTIES COMPILE_FLAGS "-Wno-nonnull-compare")
+    target_compile_options(glu32 PRIVATE -Wno-write-strings)
 elseif(USE_CLANG_CL)
     target_compile_options(glu32 PRIVATE -Wno-self-assign -Wno-unused-function -Wno-microsoft-include)
     target_compile_options(glu32 PRIVATE -Wno-deprecated-register -Wno-tautological-undefined-compare)
 endif()
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(glu32 PRIVATE -Wno-unused-but-set-variable)
+    # Prevent a warning when comparing 'this' against 0
+    set_source_files_properties(src/libnurbs/internals/arc.cc PROPERTIES COMPILE_FLAGS "-Wno-nonnull-compare")
+endif()
+
 add_importlibs(glu32 opengl32 gdi32 msvcrt kernel32 ntdll)
 add_pch(glu32 precomp.h "${PCH_SKIP_SOURCE}")
 add_cd_file(TARGET glu32 DESTINATION reactos/system32 FOR all)
index d606fbf..146ee78 100644 (file)
@@ -53,8 +53,11 @@ add_importlibs(browseui uxtheme shlwapi shell32 comctl32 gdi32 ole32 oleaut32 us
 add_pch(browseui precomp.h "${PCH_SKIP_SOURCE}")
 add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all)
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(browseui PRIVATE -Wno-unused-but-set-variable)
+endif()
+
 if(NOT MSVC)
-    target_compile_options(browseui PRIVATE "-Wno-unused-but-set-variable")
     # Binutils linker bug
     if(LTCG)
         add_target_link_flags(browseui "-Wl,--allow-multiple-definition")
index 360c785..bf64a68 100644 (file)
@@ -14,8 +14,8 @@ list(APPEND SOURCE
 add_library(shellbars OBJECT ${SOURCE})
 target_link_libraries(shellbars PRIVATE atl_classes)
 
-if(NOT MSVC)
-    target_compile_options(shellbars PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(shellbars PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 add_pch(shellbars shellbars.h SOURCE)
index 72f1542..43c3151 100644 (file)
@@ -11,8 +11,8 @@ list(APPEND SOURCE
 add_library(shellfind OBJECT ${SOURCE})
 target_link_libraries(shellfind PRIVATE atl_classes)
 
-if(NOT MSVC)
-    target_compile_options(shellfind PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(shellfind PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 add_pch(shellfind shellfind.h SOURCE)
index 640ebf6..d6bc6b7 100644 (file)
@@ -33,8 +33,8 @@ add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll)
 add_pch(winmm winemm.h SOURCE)
 add_cd_file(TARGET winmm DESTINATION reactos/system32 FOR all)
 
-if(NOT MSVC)
-    target_compile_options(winmm PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(winmm PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 add_subdirectory(midimap)
index 20c8d7b..7de68e7 100644 (file)
@@ -12,8 +12,8 @@ list(APPEND SOURCE
 
 add_library(fbtusb MODULE ${SOURCE} fbtusb.rc)
 
-if(NOT MSVC)
-    target_compile_options(fbtusb PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(fbtusb PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 set_module_type(fbtusb kernelmodedriver)
index dadf04c..06c51e7 100644 (file)
@@ -103,9 +103,10 @@ else()
     target_compile_options(ext2fs PRIVATE
         -Wno-pointer-sign -Wno-unused-function
         -Wno-unused-variable -Wno-missing-braces)
-    if (NOT CLANG)
-        target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable)
-    endif()
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 if(CLANG)
index b2e5135..9d5670a 100644 (file)
@@ -35,11 +35,13 @@ if(USE_CLANG_CL OR (NOT MSVC))
     target_compile_options(ffs PRIVATE -Wno-unused-variable -Wno-missing-braces)
     if(USE_CLANG_CL)
         target_compile_options(ffs PRIVATE -Wno-empty-body)
-    else()
-        target_compile_options(ffs PRIVATE -Wno-unused-but-set-variable)
     endif()
 endif()
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(ffs PRIVATE -Wno-unused-but-set-variable)
+endif()
+
 add_definitions(-D__KERNEL__)
 set_module_type(ffs kernelmodedriver)
 target_link_libraries(ffs memcmp ${PSEH_LIB})
index b921bbf..84e680e 100644 (file)
@@ -82,7 +82,6 @@ if(USE_CLANG_CL OR (NOT MSVC))
     target_compile_options(reiserfs PRIVATE -Wno-missing-braces -Wno-pointer-sign)
     target_compile_options(reiserfs PRIVATE -Wno-unused-function -Wno-unused-variable)
     if(NOT USE_CLANG_CL)
-        target_compile_options(reiserfs PRIVATE -Wno-unused-but-set-variable)
         target_compile_definitions(reiserfs PRIVATE __GCC__)
     endif()
 else()
@@ -92,6 +91,10 @@ else()
     target_compile_options(reiserfs PRIVATE /wd4189 /wd4142 /wd4101)
 endif()
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(reiserfs PRIVATE -Wno-unused-but-set-variable)
+endif()
+
 target_link_libraries(reiserfs memcmp ${PSEH_LIB})
 add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES)
 set_module_type(reiserfs kernelmodedriver)
index 292fe24..dd1b7a5 100644 (file)
@@ -50,8 +50,10 @@ if(MSVC)
         target_compile_options(udfs PRIVATE -Wno-tautological-unsigned-zero-compare -Wno-self-assign)
         target_compile_options(udfs PRIVATE -Wno-sometimes-uninitialized -Wno-parentheses-equality)
     endif()
-else()
-    target_compile_options(udfs PRIVATE "-Wno-unused-but-set-variable")
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(udfs PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 set_module_type(udfs kernelmodedriver)
index ac916e9..26ff48a 100644 (file)
@@ -29,11 +29,13 @@ add_driver_inf(netkvm netkvm.inf)
 if(NOT MSVC)
     target_compile_options(netkvm PRIVATE
         -Wno-unused-function
-        -Wno-old-style-declaration
         -Wno-unknown-pragmas
-        -Wno-unused-but-set-variable
         -Wno-pointer-sign
         -Wno-pointer-to-int-cast
         -Wno-int-to-pointer-cast
         -Wno-attributes)
 endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(netkvm PRIVATE -Wno-old-style-declaration -Wno-unused-but-set-variable)
+endif()
index fc80d6d..a1cee35 100644 (file)
@@ -42,7 +42,11 @@ target_compile_definitions(classpnp PRIVATE
     CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS=512)
 
 if(GCC)
-    target_compile_options(classpnp PRIVATE -Wno-unused-but-set-variable -Wno-pointer-to-int-cast -Wno-switch)
+    target_compile_options(classpnp PRIVATE -Wno-pointer-to-int-cast -Wno-switch)
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(classpnp PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 set_module_type(classpnp kernelmodedriver)
index 8c11bc3..68407ea 100644 (file)
@@ -21,7 +21,11 @@ if(USE_CLANG_CL OR (NOT MSVC))
 endif()
 
 if(GCC)
-    target_compile_options(disk PRIVATE -Wno-unused-but-set-variable -Wno-pointer-to-int-cast -Wno-switch)
+    target_compile_options(disk PRIVATE -Wno-pointer-to-int-cast -Wno-switch)
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(disk PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 set_module_type(disk kernelmodedriver)
index 0df8e74..c172d96 100644 (file)
@@ -25,11 +25,13 @@ if(USE_CLANG_CL OR (NOT MSVC))
     target_compile_options(uniata PRIVATE "-Wno-narrowing")
     if(USE_CLANG_CL)
         target_compile_options(uniata PRIVATE "-Wno-unused-const-variable")
-    else()
-        target_compile_options(uniata PRIVATE "-Wno-unused-but-set-variable")
     endif()
 endif()
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(uniata PRIVATE -Wno-unused-but-set-variable)
+endif()
+
 add_pch(uniata stdafx.h SOURCE)
 set_module_type(uniata kernelmodedriver)
 add_importlibs(uniata scsiport ntoskrnl hal)
index 0e0bd3b..327566b 100644 (file)
@@ -4,7 +4,7 @@ add_executable(symdump symdump.c)
 set_module_type(symdump win32cui)
 target_link_libraries(symdump wine)
 add_importlibs(symdump dbghelp shlwapi msvcrt kernel32 ntdll)
-if(NOT MSVC)
-    target_compile_options(symdump PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(symdump PRIVATE -Wno-unused-but-set-variable)
 endif()
 add_cd_file(TARGET symdump DESTINATION reactos/system32 FOR all)
index 41ad22b..7b080fb 100644 (file)
@@ -71,7 +71,7 @@ list(APPEND SOURCE
 add_executable(ncftp ${SOURCE} ncftp.rc)
 set_module_type(ncftp win32cui)
 target_compile_definitions(ncftp PRIVATE HAVE_UTIME_H HAVE_UNISTD_H)
-if(NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(ncftp PRIVATE -Wno-unused-but-set-variable)
 endif()
 add_importlibs(ncftp advapi32 user32 ws2_32 msvcrt kernel32)
index 7b5aba3..2d2311a 100644 (file)
@@ -1,8 +1,8 @@
 
 add_executable(logevent logevent.c logevent.rc)
 set_module_type(logevent win32cui)
-if(NOT MSVC)
-    target_compile_options(logevent PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(logevent PRIVATE -Wno-unused-but-set-variable)
 endif()
 add_importlibs(logevent advapi32 msvcrt kernel32)
 add_cd_file(TARGET logevent DESTINATION reactos/system32 FOR all)
index ca2eade..6d15201 100644 (file)
@@ -1,8 +1,8 @@
 
 add_executable(pedump pedump.c pedump.rc)
 set_module_type(pedump win32cui)
-if(NOT MSVC)
-    target_compile_options(pedump PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(pedump PRIVATE -Wno-unused-but-set-variable)
 endif()
 add_importlibs(pedump msvcrt kernel32 ntdll)
 add_cd_file(TARGET pedump DESTINATION reactos/system32 FOR all)
index 748d0f0..5d70928 100644 (file)
@@ -11,8 +11,8 @@ list(APPEND SOURCE
 
 add_executable(rosperf ${SOURCE} rosperf.rc)
 set_module_type(rosperf win32cui UNICODE)
-if(NOT MSVC)
-    target_compile_options(rosperf PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(rosperf PRIVATE -Wno-unused-but-set-variable)
 endif()
 add_importlibs(rosperf version msimg32 gdi32 shell32 advapi32 user32 ntdll msvcrt kernel32)
 add_cd_file(TARGET rosperf DESTINATION reactos/system32 FOR all)
index 16aed4a..2451bd0 100644 (file)
@@ -9,8 +9,8 @@ list(APPEND SOURCE
 
 add_executable(template_dialog ${SOURCE} dialog.rc)
 set_module_type(template_dialog win32cui)
-if(NOT MSVC)
-    target_compile_options(template_dialog PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(template_dialog PRIVATE -Wno-unused-but-set-variable)
 endif()
 add_importlibs(template_dialog user32 gdi32 comctl32 msvcrt kernel32 ntdll)
 add_cd_file(TARGET template_dialog DESTINATION reactos/system32 FOR all)
index 9eebedf..097c91f 100644 (file)
@@ -9,7 +9,7 @@ add_executable(advpack_winetest ${SOURCE})
 
 target_compile_definitions(advpack_winetest PRIVATE USE_WINE_TODOS)
 
-if (NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(advpack_winetest PRIVATE -Wno-format-overflow)
 endif()
 
index f3600c3..4654753 100644 (file)
@@ -10,7 +10,7 @@ add_executable(fusion_winetest ${SOURCE})
 
 target_compile_definitions(fusion_winetest PRIVATE USE_WINE_TODOS)
 
-if (NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(fusion_winetest PRIVATE -Wno-format-overflow)
 endif()
 
index 815c2cf..8884c47 100644 (file)
@@ -32,7 +32,7 @@ add_executable(msi_winetest
 
 target_compile_definitions(msi_winetest PRIVATE __WINESRC__ USE_WINE_TODOS)
 
-if (NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(msi_winetest PRIVATE -Wno-format-overflow)
 endif()
 
index dd2aa62..37c0d4a 100644 (file)
@@ -30,7 +30,9 @@ add_importlibs(ole32_winetest oleaut32 ole32 user32 gdi32 advapi32 msvcrt kernel
 
 if(MSVC)
     add_importlibs(ole32_winetest ntdll)
-else()
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
        target_compile_options(ole32_winetest PRIVATE -Wno-format-overflow)
 endif()
 
index b6313f4..a7051a0 100644 (file)
@@ -4,6 +4,6 @@ set_module_type(services_winetest win32cui)
 add_importlibs(services_winetest user32 advapi32 msvcrt kernel32)
 add_rostests_file(TARGET services_winetest)
 
-if (NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(services_winetest PRIVATE -Wno-format-overflow)
 endif()
index 60ba1fe..7233a79 100644 (file)
@@ -17,6 +17,6 @@ target_link_libraries(setupapi_winetest uuid)
 add_importlibs(setupapi_winetest advapi32 setupapi user32 shell32 msvcrt kernel32 ntdll)
 add_rostests_file(TARGET setupapi_winetest)
 
-if (NOT MSVC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(setupapi_winetest PRIVATE -Wno-format-overflow)
 endif()
index a9816a6..23dcd7c 100644 (file)
@@ -38,7 +38,9 @@ add_importlibs(shell32_winetest shell32 shlwapi ole32 oleaut32 user32 gdi32 adva
 
 if(MSVC)
     add_importlibs(shell32_winetest ntdll)
-else()
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(shell32_winetest PRIVATE -Wno-format-overflow)
 endif()
 
index 1321700..32f8993 100644 (file)
@@ -40,7 +40,9 @@ add_executable(user32_winetest
 if(MSVC)
     # Disable warning C4477 (printf format warnings)
     remove_target_compile_option(user32_winetest "/we4477")
-elseif(GCC)
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_options(user32_winetest PRIVATE -Wno-format-overflow)
 endif()
 
index a4d8a79..f472718 100644 (file)
@@ -10,10 +10,12 @@ add_importlibs(version_winetest shell32 version msvcrt kernel32)
 
 target_compile_definitions(version_winetest PRIVATE USE_WINE_TODOS)
 
-if (NOT MSVC)
-    target_compile_options(version_winetest PRIVATE -Wno-format-overflow)
-else()
+if(MSVC)
     add_importlibs(version_winetest ntdll)
 endif()
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(version_winetest PRIVATE -Wno-format-overflow)
+endif()
+
 add_rostests_file(TARGET version_winetest)
index d46b9e4..34b0dee 100644 (file)
@@ -24,8 +24,8 @@ list(APPEND SOURCE
 
 add_library(adns ${SOURCE})
 
-if(NOT MSVC)
-    target_compile_options(adns PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(adns PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 add_dependencies(adns psdk)
index 1a90575..b35c25d 100644 (file)
@@ -18,8 +18,8 @@ add_library(cardlib STATIC ${SOURCE})
 target_link_libraries(cardlib PRIVATE cpprt)
 target_include_directories(cardlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
 
-if(NOT MSVC)
-    target_compile_options(cardlib PRIVATE "-Wno-unused-but-set-variable")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_options(cardlib PRIVATE -Wno-unused-but-set-variable)
 endif()
 
 add_dependencies(cardlib psdk)