File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -853,6 +853,7 @@ function(myci_declare_library name)
853853 set (options
854854 NO_EXPORT
855855 NO_WARNINGS_AS_ERRORS
856+ NO_ALL_WARNINGS
856857 )
857858 set (single
858859 IDE_FOLDER
@@ -910,8 +911,14 @@ function(myci_declare_library name)
910911 set (warnings_as_errors /WX)
911912 endif ()
912913
914+ if (arg_NO_ALL_WARNINGS)
915+ set (all_warnings)
916+ else ()
917+ set (all_warnings /W4)
918+ endif ()
919+
913920 target_compile_options (${name} PRIVATE
914- $<$< COMPILE_LANGUAGE : CXX >:/ W4 >
921+ ${all_warnings}
915922 ${warnings_as_errors}
916923 # /W4 includes check for non-virtual-destructor.
917924 # There is no equivalent for -fstring-aliasing, as MSVS generally assumes a more conservative aliasing model by default.
@@ -930,12 +937,15 @@ function(myci_declare_library name)
930937 set (warnings_as_errors -Werror)
931938 endif ()
932939
940+ if (arg_NO_ALL_WARNINGS)
941+ set (all_warnings)
942+ else ()
943+ set (all_warnings -Wall $<$<COMPILE_LANGUAGE :CXX >:-Wnon -virtual -dtor >)
944+ endif ()
945+
933946 target_compile_options (${name} PRIVATE
934- # Enable more warnings only for C++ files.
935- # We don't care much about C files, as C code is only maintained by 3rd party.
936- $<$<COMPILE_LANGUAGE :CXX >:-Wall >
947+ ${all_warnings}
937948 ${warnings_as_errors}
938- $<$<COMPILE_LANGUAGE :CXX >:-Wnon -virtual -dtor > # only for C++ files
939949 -fstrict-aliasing
940950 )
941951 endif ()
You can’t perform that action at this time.
0 commit comments