Add a simple test for strict compiler warnings
This commit is contained in:
parent
bf1f1c73e3
commit
6d5e0a81c2
@ -200,4 +200,8 @@ if (FMT_PEDANTIC AND NOT WIN32)
|
|||||||
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
|
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
|
||||||
"-DPEDANTIC_COMPILE_FLAGS=${PEDANTIC_COMPILE_FLAGS}"
|
"-DPEDANTIC_COMPILE_FLAGS=${PEDANTIC_COMPILE_FLAGS}"
|
||||||
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
|
add_executable (hello_fmt hello_fmt.cc ../src/format.cc)
|
||||||
|
target_compile_options (hello_fmt PRIVATE -Wall -Wextra -Werror -pedantic -Wconversion -Wsign-conversion -Wunused -Wshadow -Wdouble-promotion -Wcast-align -Wnull-dereference)
|
||||||
|
target_include_directories( hello_fmt PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
10
test/hello_fmt.cc
Normal file
10
test/hello_fmt.cc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <fmt/core.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
fmt::print("Hello, {}!", "world"); // uses Python-like format string syntax
|
||||||
|
|
||||||
|
fmt::print("The answer is {}\n", 42);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user