File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ add_library(libblisp_obj OBJECT
1717 lib/chip/blisp_chip_bl70x.c)
1818
1919target_include_directories (libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR} /include /)
20+ if (NOT CMAKE_C_COMPILER_ID MATCHES "MSVC" )
21+ target_compile_options (libblisp_obj PRIVATE -Wall -Wextra -Wpedantic)
22+ else ()
23+ # MSVC does not support 'extra' and 'pedantic' levels to warnings.
24+ # `/Wall` seems to generate way too many non-actionable output marked as warnings.
25+ # We settle for `/W4`.
26+ # https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170
27+ target_compile_options (libblisp_obj PRIVATE -W4)
28+ endif ()
2029
2130set_property (TARGET libblisp_obj PROPERTY POSITION_INDEPENDENT_CODE 1)
2231
Original file line number Diff line number Diff line change @@ -23,6 +23,16 @@ target_link_libraries(blisp PRIVATE
2323 argtable3::argtable3
2424 libblisp_static file_parsers)
2525
26+ if (NOT CMAKE_C_COMPILER_ID MATCHES "MSVC" )
27+ target_compile_options (libblisp_obj PRIVATE -Wall -Wextra -Wpedantic)
28+ else ()
29+ # MSVC does not support 'extra' and 'pedantic' levels to warnings.
30+ # `/Wall` seems to generate way too many non-actionable output marked as warnings.
31+ # We settle for `/W4`.
32+ # https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170
33+ target_compile_options (libblisp_obj PRIVATE -W4)
34+ endif ()
35+
2636if (WIN32 )
2737 target_link_libraries (blisp PRIVATE Setupapi.lib)
2838elseif (APPLE )
You can’t perform that action at this time.
0 commit comments