diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8eba73b7..20a2bfa5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -200,4 +200,8 @@ if (FMT_PEDANTIC AND NOT WIN32) "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}" "-DPEDANTIC_COMPILE_FLAGS=${PEDANTIC_COMPILE_FLAGS}" "-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 () diff --git a/test/hello_fmt.cc b/test/hello_fmt.cc new file mode 100644 index 00000000..f1e90f84 --- /dev/null +++ b/test/hello_fmt.cc @@ -0,0 +1,10 @@ +#include + +int main() +{ + fmt::print("Hello, {}!", "world"); // uses Python-like format string syntax + + fmt::print("The answer is {}\n", 42); + + return 0; +}