Changeset - r27904:73387ac1bea0
[Not reviewed]
.github/workflows/ci-build.yml
Show inline comments
 
@@ -32,11 +32,10 @@ jobs:
 
        path: /emsdk/upstream/emscripten/cache
 
        key: 3.1.42-${{ runner.os }}
 

	
 
    - name: Patch Emscripten to support LZMA and nlohmann-json
 
    - name: Patch Emscripten to support LZMA
 
      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: |
 
@@ -118,7 +117,6 @@ jobs:
 
          libicu-dev \
 
          liblzma-dev \
 
          liblzo2-dev \
 
          nlohmann-json3-dev \
 
          ${{ matrix.libraries }} \
 
          zlib1g-dev \
 
          # EOF
 
@@ -215,7 +213,6 @@ jobs:
 
          liblzma \
 
          libpng \
 
          lzo \
 
          nlohmann-json \
 
          zlib \
 
          # EOF
 

	
 
@@ -300,7 +297,6 @@ jobs:
 
          liblzma \
 
          libpng \
 
          lzo \
 
          nlohmann-json \
 
          zlib \
 
          # EOF
 

	
 
@@ -387,7 +383,6 @@ jobs:
 
          mingw-w64-${{ matrix.arch }}-libpng
 
          mingw-w64-${{ matrix.arch }}-lld
 
          mingw-w64-${{ matrix.arch }}-ninja
 
          mingw-w64-${{ matrix.arch }}-nlohmann-json
 

	
 
    - name: Install OpenGFX
 
      shell: bash
.github/workflows/preview-build.yml
Show inline comments
 
@@ -40,11 +40,10 @@ jobs:
 
        path: /emsdk/upstream/emscripten/cache
 
        key: 3.1.42-${{ runner.os }}
 

	
 
    - name: Patch Emscripten to support LZMA and nlohmann_json
 
    - name: Patch Emscripten to support LZMA
 
      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/release-linux.yml
Show inline comments
 
@@ -130,7 +130,6 @@ jobs:
 
            liblzma \
 
            libpng \
 
            lzo \
 
            nlohmann-json \
 
            sdl2 \
 
            zlib \
 
            # EOF
.github/workflows/release-macos.yml
Show inline comments
 
@@ -75,8 +75,6 @@ jobs:
 
          libpng:arm64-osx \
 
          lzo:x64-osx \
 
          lzo:arm64-osx \
 
          nlohmann-json:x64-osx \
 
          nlohmann-json:arm64-osx \
 
          zlib:x64-osx \
 
          zlib:arm64-osx \
 
          # EOF
.github/workflows/release-windows.yml
Show inline comments
 
@@ -80,7 +80,6 @@ jobs:
 
          liblzma \
 
          libpng \
 
          lzo \
 
          nlohmann-json \
 
          zlib \
 
          # EOF
 

	
CMakeLists.txt
Show inline comments
 
@@ -119,8 +119,6 @@ endif()
 
set(CMAKE_THREAD_PREFER_PTHREAD YES)
 
# Make sure we have Threads available.
 
find_package(Threads REQUIRED)
 
# nlohmann is used for all our JSON needs.
 
find_package(nlohmann_json REQUIRED)
 

	
 
find_package(ZLIB)
 
find_package(LibLZMA)
 
@@ -310,7 +308,6 @@ link_package(PNG TARGET PNG::PNG ENCOURA
 
link_package(ZLIB TARGET ZLIB::ZLIB ENCOURAGED)
 
link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGED)
 
link_package(LZO)
 
link_package(nlohmann_json)
 

	
 
if(NOT WIN32 AND NOT EMSCRIPTEN)
 
    link_package(CURL ENCOURAGED)
COMPILING.md
Show inline comments
 
@@ -4,7 +4,6 @@
 

	
 
OpenTTD makes use of the following external libraries:
 

	
 
- (required) nlohmann-json: JSON handling
 
- (encouraged) breakpad: creates minidumps on crash
 
- (encouraged) zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
 
   heightmaps
 
@@ -55,14 +54,13 @@ the `static` versions, and OpenTTD curre
 
- liblzma
 
- libpng
 
- lzo
 
- nlohmann-json
 
- zlib
 

	
 
To install both the x64 (64bit) and x86 (32bit) variants (though only one is necessary), you can use:
 

	
 
```ps
 
.\vcpkg install breakpad:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static nlohmann-json:x64-windows-static zlib:x64-windows-static
 
.\vcpkg install breakpad:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static nlohmann-json:x86-windows-static zlib:x86-windows-static
 
.\vcpkg install breakpad:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static
 
.\vcpkg install breakpad:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static
 
```
 

	
 
You can open the folder (as a CMake project). CMake will be detected, and you can compile from there.
os/emscripten/Dockerfile
Show inline comments
 
@@ -2,6 +2,3 @@ FROM emscripten/emsdk:3.1.42
 

	
 
COPY emsdk-liblzma.patch /
 
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
 

	
 
COPY emsdk-nlohmann-json.patch /
 
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-nlohmann-json.patch
os/emscripten/README.md
Show inline comments
 
@@ -4,7 +4,6 @@ Please use docker with the supplied `Doc
 
It takes care of a few things:
 
- Use a version of emscripten we know works
 
- Patch in LibLZMA support (as this is not supported by upstream)
 
- Patch in nlohmann-json support (as this is not supported by upstream)
 

	
 
First, build the docker image by navigating in the folder this `README.md` is in, and executing:
 
```
os/emscripten/cmake/Findnlohmann_json.cmake
Show inline comments
 
deleted file
os/emscripten/emsdk-nlohmann-json.patch
Show inline comments
 
deleted file
src/3rdparty/CMakeLists.txt
Show inline comments
 
@@ -3,4 +3,5 @@ add_subdirectory(fmt)
 
add_subdirectory(icu)
 
add_subdirectory(md5)
 
add_subdirectory(squirrel)
 
add_subdirectory(nlohmann)
 
add_subdirectory(opengl)
src/3rdparty/nlohmann/CMakeLists.txt
Show inline comments
 
new file 100644
 
add_files(
 
    json.hpp
 
)
src/3rdparty/nlohmann/LICENSE.MIT
Show inline comments
 
new file 100644
 
MIT License
 

	
 
Copyright (c) 2013-2022 Niels Lohmann
 

	
 
Permission is hereby granted, free of charge, to any person obtaining a copy
 
of this software and associated documentation files (the "Software"), to deal
 
in the Software without restriction, including without limitation the rights
 
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
copies of the Software, and to permit persons to whom the Software is
 
furnished to do so, subject to the following conditions:
 

	
 
The above copyright notice and this permission notice shall be included in all
 
copies or substantial portions of the Software.
 

	
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
SOFTWARE.

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)