Changeset - r27701:fc5ed5d62184
[Not reviewed]
master
0 3 0
Loïc Guilloux - 11 months ago 2023-07-06 09:49:06
glx22@users.noreply.github.com
Fix 021c45c: [CMake] detection and use of nlohmann-json for emscripten (#11113)
3 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
.github/workflows/ci-build.yml
Show inline comments
 
@@ -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: |
.github/workflows/preview_build.yml
Show inline comments
 
@@ -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: |
os/emscripten/cmake/Findnlohmann_json.cmake
Show inline comments
 
@@ -6,10 +6,10 @@ set(CMAKE_REQUIRED_FLAGS "-sUSE_NLOHMANN
 
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"
0 comments (0 inline, 0 general)