mirror of https://github.com/OpenTTD/OpenTTD.git
Fix 021c45c: [CMake] detection and use of nlohmann-json for emscripten (#11113)
This commit is contained in:
parent
9f28da4e33
commit
5f2246eabf
|
@ -32,10 +32,11 @@ jobs:
|
|||
path: /emsdk/upstream/emscripten/cache
|
||||
key: 3.1.37-${{ runner.os }}
|
||||
|
||||
- name: Patch Emscripten to support LZMA
|
||||
- name: Patch Emscripten to support LZMA and nlohmann-json
|
||||
run: |
|
||||
cd /emsdk/upstream/emscripten
|
||||
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
|
||||
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-nlohmann-json.patch
|
||||
|
||||
- name: Build (host tools)
|
||||
run: |
|
||||
|
|
|
@ -47,10 +47,11 @@ jobs:
|
|||
path: /emsdk/upstream/emscripten/cache
|
||||
key: 3.1.37-${{ runner.os }}
|
||||
|
||||
- name: Patch Emscripten to support LZMA
|
||||
- name: Patch Emscripten to support LZMA and nlohmann_json
|
||||
run: |
|
||||
cd /emsdk/upstream/emscripten
|
||||
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
|
||||
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-nlohmann-json.patch
|
||||
|
||||
- name: Build (host tools)
|
||||
run: |
|
||||
|
|
|
@ -6,10 +6,10 @@ set(CMAKE_REQUIRED_FLAGS "-sUSE_NLOHMANN_JSON=1")
|
|||
check_cxx_source_compiles("
|
||||
#include <nlohmann/json.hpp>
|
||||
int main() { return 0; }"
|
||||
NLOHMANN_JSON_FOUND
|
||||
nlohmann_json_FOUND
|
||||
)
|
||||
|
||||
if (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"
|
||||
|
|
Loading…
Reference in New Issue