From a04af496f0e5e25a2d117b388cf7e5f58069e65c Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 25 Dec 2022 12:59:09 +0100 Subject: [PATCH] Use -ansi to build when using GCC/Clang --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61cfea9..aabc3af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,10 +13,13 @@ target_include_directories(minitar PUBLIC ${CMAKE_CURRENT_LIST_DIR}) # for minit set_target_properties(minitar PROPERTIES OUTPUT_NAME mtar) +set_target_properties(minitar PROPERTIES C_STANDARD 11) +set_target_properties(minitar PROPERTIES C_STANDARD_REQUIRED ON) + if (MSVC) target_compile_options(minitar PRIVATE /W4 /WX) else() - target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror) + target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror -ansi) endif() install(TARGETS minitar DESTINATION lib)