Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel/rttr: Fix build on 14- / modern Clang
- the bundled rapidjson doesn't build on 14- because of changes in the STL; use the version from ports instead which has the changes needed already. - the chaiscript examples don't build with modern Clang on 14-, and the examples are explicitly C++14 -- but still don't work Replace the bundled rapidjson and chaiscripts with the regular ports versions. There has been some work in git on both rttr and chaiscript, but neither has a newer release that might be pulled in, so we'll stick to messy patching of rttr instead.
- Loading branch information
Adriaan de Groot
authored and
Adriaan de Groot
committed
Nov 27, 2021
1 parent
1ed648e
commit 5a0ece2
Showing
4 changed files
with
52 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
devel/rttr/files/patch-3rd__party_rapidjson-1.1.0_rapidjson_document.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- CMake/3rd_party_libs.cmake.orig 2019-01-18 18:25:46 UTC | ||
+++ CMake/3rd_party_libs.cmake | ||
@@ -53,7 +53,8 @@ if (BUILD_BENCHMARKS OR BUILD_EXAMPLES) | ||
find_package(Threads REQUIRED) | ||
endif() | ||
|
||
-set(RAPID_JSON_DIR ${RTTR_3RD_PARTY_DIR}/rapidjson-1.1.0) | ||
+find_package(RapidJSON REQUIRED) | ||
+set(RAPID_JSON_DIR ${RapidJSON_INCLUDE_DIR}) | ||
set(NONIUS_DIR ${RTTR_3RD_PARTY_DIR}/nonius-1.1.2) | ||
|
||
# Prepare "Catch" library for other executables | ||
@@ -63,7 +64,9 @@ add_library(Catch2::Catch ALIAS Catch) | ||
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR}) | ||
|
||
# Find chai script | ||
-set(CHAISCRIPT_INCLUDE_DIR ${RTTR_3RD_PARTY_DIR}/chaiscript-6.1.0) | ||
+find_package(PkgConfig REQUIRED) | ||
+pkg_check_modules(_chaiscript REQUIRED chaiscript) | ||
+set(CHAISCRIPT_INCLUDE_DIR ${_chaiscript_INCLUDEDIR}) | ||
add_library(ChaiScript INTERFACE) | ||
add_library(ChaiScript::ChaiScript ALIAS ChaiScript) | ||
target_include_directories(ChaiScript INTERFACE ${CHAISCRIPT_INCLUDE_DIR}) |
17 changes: 17 additions & 0 deletions
17
devel/rttr/files/patch-src_examples_scripting_CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- src/examples/scripting/CMakeLists.txt.orig 2021-11-27 21:00:51 UTC | ||
+++ src/examples/scripting/CMakeLists.txt | ||
@@ -41,12 +41,12 @@ endif() | ||
|
||
add_executable(scripting_example ${SRC_FILES} ${HPP_FILES}) | ||
target_link_libraries(scripting_example RTTR::Core ChaiScript::ChaiScript ${CMAKE_DL_LIBS} Threads::Threads) | ||
-# chaiscript minimum C++ version is 14 | ||
+# chaiscript minimum C++ version is 17 | ||
set_target_properties(scripting_example | ||
PROPERTIES DEBUG_POSTFIX ${RTTR_DEBUG_POSTFIX} | ||
FOLDER "Examples" | ||
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}" | ||
- CXX_STANDARD 14) | ||
+ CXX_STANDARD 17) | ||
if (MSVC) | ||
target_compile_options(scripting_example PRIVATE /bigobj) | ||
endif() |