mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
use the same warning options like before the PR
Additional notes on how to improve the current state have been added.
This commit is contained in:
parent
b05a02b91c
commit
c0e926109e
@ -39,8 +39,6 @@ include(testCxx11)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -Wshadow -pedantic)
|
||||
elseif (MSVC)
|
||||
set(PEDANTIC_COMPILE_FLAGS /W4)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
|
@ -39,6 +39,7 @@ endif ()
|
||||
set(TEST_MAIN_SRC test-main.cc gtest-extra.cc gtest-extra.h util.cc)
|
||||
|
||||
# relax pedantic flags for the tests
|
||||
# TODO: fix warnings in tests to make this redundant. (e.g. -Wshadow,...)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wno-long-long -Wno-variadic-macros)
|
||||
endif ()
|
||||
@ -69,6 +70,13 @@ add_fmt_test(format-impl-test)
|
||||
add_fmt_test(printf-test)
|
||||
add_fmt_test(util-test mock-allocator.h)
|
||||
|
||||
# Enable stricter options for one test to make sure that the header is free of
|
||||
# warnings.
|
||||
# TODO: make all tests warning free and add this flag to PEDANTIC_COMPILE_FLAGS
|
||||
if (FMT_PEDANTIC AND MSVC)
|
||||
target_compile_options(format-test PRIVATE /W4)
|
||||
endif ()
|
||||
|
||||
add_executable(macro-test macro-test.cc ${TEST_MAIN_SRC})
|
||||
target_link_libraries(macro-test gmock cppformat)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user