Skip to content
Snippets Groups Projects
Verified Commit ca07c6b7 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Add option to disable implicit json conversions

parent e13a71d3
No related branches found
No related tags found
No related merge requests found
Pipeline #3253 passed
......@@ -69,6 +69,7 @@ build synapse arm64:
-DCMAKE_BUILD_TYPE=Debug -DHUNTER_CONFIGURATION_TYPES=Debug
-DCI_BUILD=ON
-DCOVERAGE=${COVERAGE}
-DJSON_ImplicitConversions=OFF
- cmake --build build
- MTXCLIENT_SERVER=synapse GTEST_OUTPUT=xml:junit-output/ make test
after_script:
......
......@@ -53,6 +53,7 @@ option(BUILD_LIB_EXAMPLES "Build examples" ON)
option(COVERAGE "Calculate test coverage" OFF)
option(IWYU "Check headers with include-what-you-use" OFF)
option(BUILD_SHARED_LIBS "Specifies whether to build mtxclient as a shared library lib or not" ON)
option(JSON_ImplicitConversions "Disable implicit conversions in nlohmann/json" ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -262,6 +263,14 @@ target_include_directories(
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
if (NOT JSON_ImplicitConversions)
set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "JSON_USE_IMPLICIT_CONVERSIONS=\$<BOOL:OFF>;JSON_DIAGNOSTICS=\$<BOOL:OFF>"
)
target_compile_definitions(matrix_client PUBLIC JSON_USE_IMPLICIT_CONVERSIONS=0)
endif()
target_link_libraries(matrix_client
PUBLIC
OpenSSL::Crypto
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment