Use -ansi to build when using GCC/Clang

This commit is contained in:
apio 2022-12-25 12:59:09 +01:00
parent 23c313d9cf
commit a04af496f0
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -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 OUTPUT_NAME mtar)
set_target_properties(minitar PROPERTIES C_STANDARD 11)
set_target_properties(minitar PROPERTIES C_STANDARD_REQUIRED ON)
if (MSVC) if (MSVC)
target_compile_options(minitar PRIVATE /W4 /WX) target_compile_options(minitar PRIVATE /W4 /WX)
else() else()
target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror) target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror -ansi)
endif() endif()
install(TARGETS minitar DESTINATION lib) install(TARGETS minitar DESTINATION lib)