Skip to content

Commit 6f2a72c

Browse files
committed
cmake: msvc warnings only for C++
1 parent 0e386f9 commit 6f2a72c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/cmake/modules/myci.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ function(myci_declare_library name)
899899
# enable sane warnings and other compiler options
900900
if(MSVC)
901901
target_compile_options(${name} PRIVATE
902-
/W4
903-
/WX # warnings = errors
902+
$<$<COMPILE_LANGUAGE:CXX>:/W4>
903+
$<$<COMPILE_LANGUAGE:CXX>:/WX> # warnings = errors
904904
# /W4 includes check for non-virtual-destructor.
905905
# There is no equivalent for -fstring-aliasing, as MSVS generally assumes a more conservative aliasing model by default.
906906

@@ -1186,8 +1186,8 @@ function(myci_declare_application name)
11861186
# enable sane warnings and other compiler options
11871187
if(MSVC)
11881188
target_compile_options(${name} PRIVATE
1189-
/W4
1190-
/WX # warnings = errors
1189+
$<$<COMPILE_LANGUAGE:CXX>:/W4>
1190+
$<$<COMPILE_LANGUAGE:CXX>:/WX> # warnings = errors
11911191
# /W4 includes check for non-virtual-destructor.
11921192
# There is no equivalent for -fstring-aliasing, as MSVS generally assumes a more conservative aliasing model by default.
11931193

0 commit comments

Comments
 (0)