From 7763148aeaa6c596a92a58d74fd9bebb52fbbc46 Mon Sep 17 00:00:00 2001 From: Xerbo Date: Wed, 2 Sep 2020 20:20:20 +0100 Subject: [PATCH] More verbose output when building with CMake --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e073ad..fa3b376 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,16 @@ add_executable(aptdec ${C_SOURCE_FILES}) add_compile_definitions(PALETTE_DIR="${CMAKE_SOURCE_DIR}/palettes") -# math +# Math target_link_libraries(aptdec PRIVATE m) +# Throw errors on warnings on release builds +if(CMAKE_BUILD_TYPE MATCHES "Release") + target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic -Werror) +else() + target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic) +endif() + # libpng target_link_libraries(aptdec PRIVATE PNG::PNG) if(WIN32 AND NOT MINGW) @@ -39,7 +46,8 @@ IF(NOT WIN32) install(TARGETS aptdec DESTINATION "bin/") install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "lib/aptdec/palettes") else() - set(CPACK_GENERATOR "ZIP;NSIS") + #set(CPACK_GENERATOR "ZIP;NSIS") + set(CPACK_GENERATOR "ZIP") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") install(TARGETS aptdec DESTINATION "bin/")