mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 00:21:13 +00:00
Use /W4 in format-test and only if FMT_EXTRA_TESTS is set
as (1) we don't want to force /W4 on users of the library and (2) some of the warnings only show up when the formatting functions are used.
This commit is contained in:
parent
9c75d0ccf7
commit
60405cf693
@ -83,8 +83,6 @@ add_library(format ${FMT_SOURCES})
|
|||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set_target_properties(format PROPERTIES COMPILE_FLAGS
|
set_target_properties(format PROPERTIES COMPILE_FLAGS
|
||||||
"-Wall -Wextra -Wshadow -pedantic")
|
"-Wall -Wextra -Wshadow -pedantic")
|
||||||
elseif (MSVC)
|
|
||||||
set_target_properties(format PROPERTIES COMPILE_FLAGS /W4)
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# If FMT_EXTRA_TESTS is TRUE, then test compilation with both -std=c++11
|
# If FMT_EXTRA_TESTS is TRUE, then test compilation with both -std=c++11
|
||||||
|
@ -24,6 +24,10 @@ endif ()
|
|||||||
|
|
||||||
add_fmt_test(gtest-extra-test)
|
add_fmt_test(gtest-extra-test)
|
||||||
add_fmt_test(format-test)
|
add_fmt_test(format-test)
|
||||||
|
if (FMT_EXTRA_TESTS AND MSVC)
|
||||||
|
set_target_properties(format-test PROPERTIES COMPILE_FLAGS /W4)
|
||||||
|
endif ()
|
||||||
|
|
||||||
add_fmt_test(format-impl-test CUSTOM_LINK)
|
add_fmt_test(format-impl-test CUSTOM_LINK)
|
||||||
add_fmt_test(printf-test)
|
add_fmt_test(printf-test)
|
||||||
foreach (target format-test printf-test)
|
foreach (target format-test printf-test)
|
||||||
|
Loading…
Reference in New Issue
Block a user