diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2019-08-07 09:32:48 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2019-08-07 09:32:48 +0200 |
commit | 40f3d0030e6e98bcb02d6523e5ee48497dec49a6 (patch) | |
tree | a992f9a6acd3edc2c7bb6b1aba2e52084918c9ab /CMakeLists.txt | |
parent | e25c754918ae26e8b9e68a47bc1af36248e91800 (diff) |
New upstream version 6.9.3upstream/6.9.3
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f3eca6b..c59bfe3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,28 +1,19 @@ cmake_minimum_required(VERSION 3.1) -project(oniguruma VERSION 6.9.2) +project(oniguruma + VERSION 6.9.3 + LANGUAGES C) set(PACKAGE onig) set(PACKAGE_VERSION ${PROJECT_VERSION}) option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(ENABLE_POSIX_API "Include POSIX API" ON) - -set(USE_CRNL_AS_LINE_TERMINATOR 0) -set(VERSION ${PACKAGE_VERSION}) - if(MSVC) - # Force to always compile with W4 - if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") - string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - endif() -elseif(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -elseif(CMAKE_COMPILER_IS_GNUCC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + option(MSVC_STATIC_RUNTIME "Build with static runtime" OFF) endif() +set(USE_CRNL_AS_LINE_TERMINATOR 0) +set(VERSION ${PACKAGE_VERSION}) include(CheckCSourceCompiles) include(CheckIncludeFiles) @@ -73,6 +64,26 @@ target_include_directories(onig PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) +if(MSVC) + target_compile_options(onig PRIVATE + #/W4 + ) + if(MSVC_STATIC_RUNTIME) + target_compile_options(onig PRIVATE + $<$<CONFIG:Release>:/MT> + $<$<CONFIG:Debug>:/MTd> + $<$<CONFIG:MinSizeRel>:/MT> + $<$<CONFIG:RelWithDebgInfo>:/MTd> + ) + target_compile_definitions(onig PUBLIC -DONIG_STATIC) + endif() +elseif(CMAKE_COMPILER_IS_GNUCC) + target_compile_options(onig PRIVATE + -Wall + ) +endif() + + # Installation (https://github.com/forexample/package-example) # Introduce variables: |