diff options
| author | Mark Rowe <mark@vector35.com> | 2026-02-06 00:47:19 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-04-15 12:46:37 -0700 |
| commit | 6c34643b639607d7c0a652300bbdbc261fbe2388 (patch) | |
| tree | c9709bb2da6950d9335878958422e733878287e8 /CMakeLists.txt | |
| parent | 877b01ac02ca4e63b0cacbef4f641b73f7d6298e (diff) | |
Compile jsoncpp into a different namespace when building as part of core
This allows it to be compiled into statically linked builds without
causing ODR violations.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 912eeea6..a8dd693b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,16 +17,13 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) endif() endif() -file(GLOB BN_API_SOURCES CONFIGURE_DEPENDS *.cpp *.h json/json.h json/json-forwards.h) -if(NOT DEMO) - list(APPEND BN_API_SOURCES json/jsoncpp.cpp) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - set_source_files_properties(json/jsoncpp.cpp PROPERTIES COMPILE_FLAGS /w) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set_source_files_properties(json/jsoncpp.cpp PROPERTIES COMPILE_FLAGS -Wno-everything) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set_source_files_properties(json/jsoncpp.cpp PROPERTIES COMPILE_FLAGS -w) - endif() +file(GLOB BN_API_SOURCES CONFIGURE_DEPENDS *.cpp *.h json/*.cpp json/*.h) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set_source_files_properties(json/jsoncpp.cpp PROPERTIES COMPILE_FLAGS /w) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_source_files_properties(json/jsoncpp.cpp PROPERTIES COMPILE_FLAGS -Wno-everything) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set_source_files_properties(json/jsoncpp.cpp PROPERTIES COMPILE_FLAGS -w) endif() if(NOT BN_INTERNAL_BUILD) |
