EANX_CC: allow for check digit + buffer overflow for too long add-on; GUI text colour; cmake 3.0

This commit is contained in:
gitlost
2020-10-05 23:22:06 +01:00
parent 0617a5fec0
commit 90012ab23f
12 changed files with 431 additions and 107 deletions

View File

@ -1,6 +1,7 @@
# (c) 2008 by BogDan Vatra < bogdan@licentia.eu >
# vim: set ts=4 sw=4 et :
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)
project(zint-package)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -14,7 +15,7 @@ set (ZINT_VERSION_RELEASE 1)
set (ZINT_VERSION_BUILD ".9") # Set to "" before release, set to ".9" after release
set (ZINT_VERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}.${ZINT_VERSION_RELEASE}${ZINT_VERSION_BUILD}" )
add_definitions (-DZINT_VERSION=\"${ZINT_VERSION}\" -Wall)
add_definitions(-DZINT_VERSION=\"${ZINT_VERSION}\")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
@ -25,31 +26,50 @@ set(ZINT_STATIC FALSE CACHE BOOL "Build static library")
include (SetPaths.cmake)
INCLUDE (CheckCXXCompilerFlag)
include(CheckCXXCompilerFlag)
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
check_cxx_compiler_flag("-Wall" CXX_COMPILER_FLAG_WALL)
if (CXX_COMPILER_FLAG_WALL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif (CXX_COMPILER_FLAG_WALL)
if (ZINT_DEBUG)
check_cxx_compiler_flag("-Wall" CXX_COMPILER_FLAG_WALL)
if(CXX_COMPILER_FLAG_WALL)
add_compile_options("-Wall")
endif()
check_cxx_compiler_flag("-Wextra" CXX_COMPILER_FLAG_WEXTRA)
if(CXX_COMPILER_FLAG_WEXTRA)
add_compile_options("-Wextra")
endif()
check_cxx_compiler_flag("-Wpedantic" CXX_COMPILER_FLAG_WPEDANTIC)
if(CXX_COMPILER_FLAG_WPEDANTIC)
add_compile_options("-Wpedantic")
endif()
if(ZINT_DEBUG)
check_cxx_compiler_flag("-g" CXX_COMPILER_FLAG_G)
if(CXX_COMPILER_FLAG_G)
add_compile_options("-g")
endif()
check_cxx_compiler_flag("-O0" CXX_COMPILER_FLAG_O0)
if(CXX_COMPILER_FLAG_O0)
add_compile_options("-O0")
endif (ZINT_DEBUG)
if (ZINT_SANITIZE)
add_compile_options("-fsanitize=undefined")
add_compile_options("-fsanitize=address")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address")
endif (ZINT_SANITIZE)
if (ZINT_TEST)
add_definitions("-DZINT_TEST")
endif (ZINT_TEST)
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
if(ZINT_SANITIZE)
add_compile_options(-fsanitize=undefined -fsanitize=address)
link_libraries(-fsanitize=undefined -fsanitize=address)
# Gives warning on MainWindow::setupUI() and retries (and takes forever) if var-tracking-assignments enabled
add_compile_options(-fno-var-tracking-assignments)
endif()
endif()
if(ZINT_TEST)
add_definitions("-DZINT_TEST")
endif()
IF(APPLE)
IF (UNIVERSAL) # TODO: make univeral binary
IF(NOT ZINT_HAS_BEEN_RUN_BEFORE and UNIVERAL)
IF (UNIVERSAL) # TODO: make universal binary
IF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk OR EXISTS /SDKs/MacOSX10.5.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -Wl -single_module " CACHE STRING "Flags used by the compiler during all build types." FORCE)
@ -125,5 +145,3 @@ install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_MODULES_INSTALL_P
IF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
SET(ZINT_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
ENDIF(NOT ZINT_HAS_BEEN_RUN_BEFORE)