summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2019-06-10 20:41:25 +0200
committerSebastian Pipping <sebastian@pipping.org>2019-06-10 20:41:25 +0200
commit70c92bbb2e496b2ba95fb072041e11d37b6349cd (patch)
tree157a3584bb40d3343f1be2126dc52b091bdae466
parentc3591a9687f6311fff1072d791536f644491f697 (diff)
parentfb5a36eb53ffa239a7d8161f7659bb3f4ba32b5a (diff)
downloaduriparser-70c92bbb2e496b2ba95fb072041e11d37b6349cd.tar.gz
Merge branch 'be-okay-without-cxx-compiler' (fixes #69)
-rw-r--r--CMakeLists.txt29
-rw-r--r--ChangeLog2
-rw-r--r--THANKS1
3 files changed, 21 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e74b874..af9a844 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,8 @@ cmake_minimum_required(VERSION 3.3)
project(uriparser
VERSION
0.9.3
+ LANGUAGES
+ C
)
# See https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
@@ -74,20 +76,17 @@ if(URIPARSER_BUILD_TOOLS AND NOT URIPARSER_BUILD_CHAR)
message(SEND_ERROR "URIPARSER_BUILD_TOOLS=ON requires URIPARSER_BUILD_CHAR=ON.")
endif()
+macro(uriparser_apply_msvc_runtime_to ref)
+ string(REGEX REPLACE "/M[DT]d?" ${URIPARSER_MSVC_RUNTIME} ${ref} "${${ref}}")
+endmacro()
+
if(MSVC AND URIPARSER_MSVC_RUNTIME)
- set(_refs
- CMAKE_CXX_FLAGS
- CMAKE_CXX_FLAGS_DEBUG
- CMAKE_CXX_FLAGS_RELEASE
- CMAKE_C_FLAGS
- CMAKE_C_FLAGS_DEBUG
- CMAKE_C_FLAGS_RELEASE
- )
- foreach(_ref ${_refs})
- string(REGEX REPLACE "/M[DT]d?" ${URIPARSER_MSVC_RUNTIME} ${_ref} "${${_ref}}")
- endforeach()
+ uriparser_apply_msvc_runtime_to(CMAKE_C_FLAGS)
+ uriparser_apply_msvc_runtime_to(CMAKE_C_FLAGS_DEBUG)
+ uriparser_apply_msvc_runtime_to(CMAKE_C_FLAGS_RELEASE)
endif()
+
#
# Compiler checks
#
@@ -242,6 +241,14 @@ endif()
# C++ test runner
#
if(URIPARSER_BUILD_TESTS)
+ enable_language(CXX)
+
+ if(MSVC AND URIPARSER_MSVC_RUNTIME)
+ uriparser_apply_msvc_runtime_to(CMAKE_CXX_FLAGS)
+ uriparser_apply_msvc_runtime_to(CMAKE_CXX_FLAGS_DEBUG)
+ uriparser_apply_msvc_runtime_to(CMAKE_CXX_FLAGS_RELEASE)
+ endif()
+
enable_testing()
find_package(GTest 1.8.0 REQUIRED)
diff --git a/ChangeLog b/ChangeLog
index 6baa983..bf17885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@ NOTE: uriparser is looking for help with a few things:
* Fixed: testrunner: No longer crashes when compiled with NDEBUG (GitHub #67)
* Fixed: CMake: Support GTest 1.8.0 (GitHub #68)
Thanks to Ryan Schmidt for the related report!
+ * Improved: Make -DURIPARSER_BUILD_TESTS=OFF unlock compilation without
+ a C++ compiler; thanks to Fabrice Fontaine for the patch! (GitHub #69)
* Soname: TODO
2019-04-28 -- 0.9.3
diff --git a/THANKS b/THANKS
index 68753cf..bddb962 100644
--- a/THANKS
+++ b/THANKS
@@ -17,6 +17,7 @@ Dr. Michael Lauer
Ed Schouten
Edward Z. Yang
Eren Türkay
+Fabrice Fontaine
Friedrich Delgado Friedrichs
Gary Mazzaferro
Graham Percival