Codechange: vendor the nlohmann-json library (#11290)
(cherry picked from commit ba67f39db6)
# Conflicts:
# .github/workflows/ci-build.yml
# CMakeLists.txt
# COMPILING.md
# src/os/macosx/survey_osx.cpp
# src/os/windows/survey_win.cpp
# src/script/api/script_admin.cpp
# src/script/api/script_event_types.cpp
# src/tests/test_script_admin.cpp
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
# nlohmann-json is a custom addition to the emscripten SDK, so it is possible
|
||||
# someone patched their SDK. Test out if the SDK supports nlohmann-json.
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(CMAKE_REQUIRED_FLAGS "-sUSE_NLOHMANN_JSON=1")
|
||||
|
||||
check_cxx_source_compiles("
|
||||
#include <nlohmann/json.hpp>
|
||||
int main() { return 0; }"
|
||||
nlohmann_json_FOUND
|
||||
)
|
||||
|
||||
if (nlohmann_json_FOUND)
|
||||
add_library(nlohmann_json INTERFACE IMPORTED)
|
||||
set_target_properties(nlohmann_json PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "-sUSE_NLOHMANN_JSON=1"
|
||||
INTERFACE_LINK_LIBRARIES "-sUSE_NLOHMANN_JSON=1"
|
||||
)
|
||||
set(nlohmann_json_LIBRARY "nlohmann_json")
|
||||
else()
|
||||
message(WARNING "You are using an emscripten SDK without nlohmann-json support. Please apply 'emsdk-nlohmann_json.patch' to your local emsdk installation.")
|
||||
endif()
|
||||
Reference in New Issue
Block a user