Skip to content

Commit

Permalink
Full CMake rewrite using modern CMake conventions
Browse files Browse the repository at this point in the history
Partial rewrite originally written by @hobyst in #446 and #551.
Remaining code and changes written by @mikke89.

These changes should generally be feature-complete with the previous CMake code, with some exceptions to legacy and certain Apple-specific behavior. Please see the changelog for breaking changes, in particular, several options, CMake targets, and file names have been changed.

The following lists some noteworthy changes:

- CMake presets now available.
- Major changes to CI automation and tests.
  - Most tests on Appveyor are moved to Github actions. This includes a completely new packaging workflow on GitHub.
  - Packaging now uses Visual Studio 2019 instead of 2017. Keep Appveyor only for testing with Visual Studio 2017.
  - Use CMake scripts for some packaging tasks to avoid avoid duplicate workflow code.
- `RmlUi::RmlUi` is now an include-all library target, while components like `RmlUi::Core` and `RmlUi::Debugger` can be chosen individually.
- Add `contributing.md` guidelines for CMake.
- Backends can now be changed without recompiling the whole library.
- Set CMake `policy_max` to a recent version. This opts in to a number of CMake improvements for users that can take advantage of that.
- Sample bitmapfont now available without FreeType.
- Runtime outputs are now placed in the binary root directory.
- Runtime dependencies can now be installed automatically, this includes dependencies from vcpkg.
- Update .editorconfig and format all CMake files consistently.
- Rename `harfbuzzshaping` sample to `harfbuzz`.
- Fix harfbuzz compatibility for older versions.
- Remove CMake warning on FreeType version.

In the following, some working notes and lessons learned are written down (authored by @mikke89):

- Avoid separate libraries for subparts of Core

  Originally, parts of core such as Elements, Layout and FontEngineDefault, were added as interface libraries. Defining these as interface libraries cause issues during export. I believe we would have to export them as separate targets, but that doesn't relly make sense from a client standpoint and causes new issues with exported source files and dependencies. It seems to be a lot less troublesome to use a single CMake library and set properties and attach sources to that directly.

- Avoid interface libraries for plugins and Lua dependencies

  Using interface libraries to add plugins causes problems when installing targets. Even trying to split the interface libraries into private and public parts did not work suitably. An issue arises when compiling the project as static libraries. Consider when we are linking targets to rmlui_core. Even when they are added as private dependencies, CMake adds it as a transient link-time dependency. This even applies to interface dependencies, which causes problems for our private interface libraries representing the plugins. In particular, CMake wants us to export these libraries, as now they are referenced from rmlui_core, but we don't want to export them, as that was the whole point of making them private and would cause new issues.

  Instead, add the SVG and Lottie source files and imported dependencies directly to Core. This simplifies things quite a bit, and seems to work reliably. For similar reasons, use imported interface targets instead of a pure interface library for the custom Lua target.

- Common options for CMake targets

  Using CMake presets to specify compiler flags, warnings in particular, is not a great experience. Presets require one to set all the flags at the same time (in a single variable). For example, we can't easily set just /WX in one profile and /MP in another. There are workarounds, but being more pragmatic, setting these flags in a cmake file is much more straightforward with proper conditionals.

- On CMake presets

  I also experimented with more detailed, platform-dependent presets, but found that it is not really that useful. In particular, we want users themselves to use whichever compilers and generators they want to rather than to constrain the choices. We strive to be agnostict toward both generators and platforms. This way, we we can also give more common build instructions regardless of platform.

  Also tested with making presets for e.g. vcpkg and mingw toolchains. However, this doesn't really make sense in presets. First of all, the choice of such a toolchain is not mutually exclusive with the current presets, so we would have to replicate most of them for each toolchain we wanted to support. Further, the exact specifics of these toolcahins, like version, platform, install location, and so on, is very specific to each case. Thus, if we wanted to handle these it would create additional dimensions to the presets, and we'd end up with a huge list of similar presets we would have to mainatain and which users would have to choose from. Or alternatively, users would have to provide a lot of their setup in any case, thereby dismissing some of the initially considered usefulness. Instead, many tools already allow you to setup a toolchain first which can then be used with a given preset. Thus, making the choice of toolchains and cmake presets orthogonal makes a lot more sense.

  One unfortunate issue from a user-friendliness perspective is that the cmake gui doesn't allow you to select a preset without a specified generator. There's an issue for this here: https://gitlab.kitware.com/cmake/cmake/-/issues/23341
  I figured accepting this for now is better than duplicating all our presets to specify different generators. But the situations is not ideal, hopefully it will be fixed soon.

- Recommended compiler flags

  The compiler flags are enabled by default to ensure users get a good experience when building the library without fiddling with options. Especially on MSVC, the default compiler flags means really slow builds (no /MP), and we also risk exposing more warnings.

Co-authored-by: Michael Ragazzon <michael.ragazzon@gmail.com>
  • Loading branch information
hobyst and mikke89 committed May 7, 2024
1 parent b21fd69 commit 2354ef7
Show file tree
Hide file tree
Showing 114 changed files with 3,570 additions and 3,685 deletions.
123 changes: 12 additions & 111 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,126 +1,27 @@
version: build.{build}

image:
- Visual Studio 2017
image: Visual Studio 2017

environment:
FREETYPE_VER: 2.10.1
VS_SHORTNAME: vs2017
matrix:
- VS_GENERATOR: Visual Studio 15 2017 Win64
PLATFORM_NAME: win64
- VS_GENERATOR: Visual Studio 15 2017
PLATFORM_NAME: win32
FREETYPE_VER: 2.11.1
VS_GENERATOR: Visual Studio 15 2017 Win64

install:
- cmd: |-
cd Dependencies
appveyor DownloadFile https://github.com/ubawurinna/freetype-windows-binaries/releases/download/v%FREETYPE_VER%/freetype.zip
unzip -o freetype.zip -d freetype_tmp
mv freetype_tmp/include include
mv freetype_tmp/%PLATFORM_NAME% lib
git clone --depth 1 --branch v0.2 https://github.com/Samsung/rlottie.git
cd rlottie
mkdir build
cd build
cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=OFF -DLOTTIE_MODULE=OFF ..
cmake --build . --target rlottie --config Debug -- "/clp:ErrorsOnly"
cmake --build . --target rlottie --config Release -- "/clp:ErrorsOnly"
cd ../../
git clone --depth 1 --branch v2.3.1 https://github.com/sammycage/lunasvg.git
cd lunasvg
mkdir build
cd build
cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=OFF -DLUNASVG_BUILD_EXAMPLES=OFF ..
cmake --build . --target lunasvg --config Debug -- "/clp:ErrorsOnly"
cmake --build . --target lunasvg --config Release -- "/clp:ErrorsOnly"
cd ../../
appveyor DownloadFile https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v%FREETYPE_VER%.zip
unzip -o v%FREETYPE_VER%.zip
mv "freetype-windows-binaries-%FREETYPE_VER%/include" include
mv "freetype-windows-binaries-%FREETYPE_VER%/release dll/win64" lib
cd ..
mkdir Build-Dynamic, Build-Static, Build-Samples
cd Build-Dynamic
cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=ON -DBUILD_SAMPLES=OFF -DWARNINGS_AS_ERRORS=ON ..
cd ../Build-Static
cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=OFF -DBUILD_SAMPLES=OFF -DWARNINGS_AS_ERRORS=ON ..
cd ../Build-Samples
cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=ON -DENABLE_LOTTIE_PLUGIN=ON -DENABLE_SVG_PLUGIN=ON -DBUILD_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON ..
cd ..
cmake -B Build -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=ON -DRMLUI_WARNINGS_AS_ERRORS=ON
build_script:
- cmd: |-
msbuild Build-Dynamic/RmlUi.sln /p:configuration=debug /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
msbuild Build-Dynamic/RmlUi.sln /p:configuration=release /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
msbuild Build-Static/RmlUi.sln /p:configuration=debug /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
msbuild Build-Static/RmlUi.sln /p:configuration=release /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
msbuild Build-Samples/RmlUi.sln /p:configuration=release /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
cmake --build Build --config Debug -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
cmake --build Build --config Release -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
after_build:
- cmd: |-
mkdir Bin
cd Bin
mkdir Dynamic-Debug, Dynamic-Release, Static-Debug, Static-Release
cp ../Build-Dynamic/Debug/Rml*.{lib,dll,pdb} Dynamic-Debug
cp ../Build-Dynamic/Release/Rml*.{lib,dll} Dynamic-Release
cp ../Build-Static/Debug/Rml*.{lib,pdb} Static-Debug
cp ../Build-Static/Release/Rml*.lib Static-Release
cd ..
cp Build-Samples/Release/*.exe Samples
cp Build-Samples/Release/Rml*.dll Samples
cp Dependencies/lib/*.dll Samples
mv Dependencies/lib/ Dependencies/freetype-%FREETYPE_VER%
cp Dependencies/freetype_tmp/*.TXT Dependencies/freetype-%FREETYPE_VER%
IF NOT "%APPVEYOR_REPO_TAG_NAME%"=="" SET RMLUI_VERSION= %APPVEYOR_REPO_TAG_NAME%
echo RmlUi%RMLUI_VERSION% library and sample binaries for %PLATFORM_NAME%.> Build.txt& echo.>>Build.txt
echo https://github.com/mikke89/RmlUi>> Build.txt& echo.>>Build.txt
echo Built using %VS_GENERATOR% on %APPVEYOR_REPO_COMMIT_TIMESTAMP:~0,10% (build %APPVEYOR_BUILD_NUMBER%).>> Build.txt
echo Commit id: %APPVEYOR_REPO_COMMIT%.>> Build.txt
cd Dependencies/rlottie/
echo The rlottie library includes source code licensed under Mozilla Public License Version 2.0.> MPL_SOURCE.txt
echo The source for this code can be found in the rlottie library at the following URL:>> MPL_SOURCE.txt
echo https://github.com/Samsung/rlottie/blob/29b391b95913877b7234543da8b4a9ec6d8175d0/src/vector/vinterpolator.cpp>> MPL_SOURCE.txt
cd ../..
cp Include/RmlUi/Core/Containers/LICENSE.txt LICENSE.Core.ThirdParty.txt
cp Source/Debugger/LICENSE.txt LICENSE.Debugger.ThirdParty.txt
7z a RmlUi-%VS_SHORTNAME%-%PLATFORM_NAME%.zip Backends/ Bin/ Include/ Samples/ Build.txt readme.md changelog.md LICENSE* Dependencies/freetype-%FREETYPE_VER%/ Dependencies/rlottie/COPYING Dependencies/rlottie/MPL_SOURCE.txt Dependencies/rlottie/licenses/ Dependencies/lunasvg/LICENSE
mkdir Samples\Dependencies\freetype-%FREETYPE_VER%, Samples\Dependencies\rlottie, Samples\Dependencies\rlottie\licenses, Samples\Dependencies\lunasvg
cp LICENSE* Samples
cp Dependencies/freetype-%FREETYPE_VER%/*.TXT Samples/Dependencies/freetype-%FREETYPE_VER%
cp Dependencies/rlottie/COPYING Samples/Dependencies/rlottie
cp Dependencies/rlottie/MPL_SOURCE.txt Samples/Dependencies/rlottie
cp Dependencies/rlottie/licenses/* Samples/Dependencies/rlottie/licenses
cp Dependencies/lunasvg/LICENSE Samples/Dependencies/lunasvg
IF "%PLATFORM_NAME%"=="win64" 7z a RmlUi-%PLATFORM_NAME%-samples-only.zip .\Samples\* -r -xr!src\ -x!shell\ -x!luainvaders\
artifacts:
- path: RmlUi-*.zip
deploy:
release: RmlUi $(APPVEYOR_REPO_TAG_NAME)
description: 'Release description'
provider: GitHub
auth_token:
secure: YN5NBflQ6G3yLsNYRPTjgz5vXqaZeIstxzRx4XqC8VVOUKL/TY2JOdxNQKTZOwLM
artifact: /.*\.zip/
draft: true
prerelease: false
on:
APPVEYOR_REPO_TAG: true
- cmd: |-
ls Build/*/*.dll -s -h -X
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
root = true

[CMakeLists.txt]
[{CMakeLists.txt,*.cmake,*.cmake.in}]
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[CMakePresets.json]
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
Expand Down
148 changes: 95 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,37 @@ jobs:
include:
- cc: clang
cxx: clang++
cmake_options: -DENABLE_PRECOMPILED_HEADERS=OFF -DSAMPLES_BACKEND=GLFW_GL2
cmake_options: -DRMLUI_BACKEND=GLFW_GL2 -DRMLUI_PRECOMPILED_HEADERS=OFF
- cc: clang
cxx: clang++
cmake_options: -DBUILD_TESTING=ON -DSAMPLES_BACKEND=SDL_VK -DCMAKE_BUILD_TYPE=Debug
- cmake_options: -DBUILD_TESTING=ON -DENABLE_PRECOMPILED_HEADERS=OFF
cmake_options: -DRMLUI_BACKEND=SDL_VK -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
- cmake_options: -DRMLUI_BACKEND=GLFW_GL3 -DBUILD_TESTING=ON
enable_testing: true
- cmake_options: -DNO_FONT_INTERFACE_DEFAULT=ON -DENABLE_LOTTIE_PLUGIN=ON -DSAMPLES_BACKEND=X11_GL2
- cmake_options: -DDISABLE_RTTI_AND_EXCEPTIONS=ON -DSAMPLES_BACKEND=SDL_GL2
- cmake_options: -DNO_THIRDPARTY_CONTAINERS=ON -DSAMPLES_BACKEND=SFML_GL2
- cmake_options: -DSAMPLES_BACKEND=SDL_VK -DRMLUI_VK_DEBUG=ON -DENABLE_PRECOMPILED_HEADERS=OFF -DCMAKE_BUILD_TYPE=Debug
- cmake_options: -DRMLUI_BACKEND=X11_GL2 -DRMLUI_LOTTIE_PLUGIN=ON
- cmake_options: -DRMLUI_BACKEND=SDL_GL2 -DRMLUI_CUSTOM_RTTI=ON -DCMAKE_CXX_FLAGS="-fno-exceptions -fno-rtti"
- cmake_options: -DRMLUI_BACKEND=SFML_GL2 -DRMLUI_THIRDPARTY_CONTAINERS=OFF
- cmake_options: -DRMLUI_BACKEND=GLFW_VK -DCMAKE_BUILD_TYPE=Debug -DRMLUI_VK_DEBUG=ON -DRMLUI_PRECOMPILED_HEADERS=OFF

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Dependencies
run: |-
sudo apt-get update
sudo apt-get install cmake ninja-build libsdl2-dev libsdl2-image-dev libfreetype6-dev libglew-dev liblua5.2-dev libsfml-dev librlottie-dev libglfw3-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/Build
sudo apt-get install cmake ninja-build libsdl2-dev libsdl2-image-dev libfreetype6-dev libharfbuzz-dev libglew-dev liblua5.2-dev libsfml-dev librlottie-dev libglfw3-dev
- name: Configure CMake
working-directory: ${{github.workspace}}/Build
run: >-
cmake $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON
cmake -B Build -G Ninja --preset samples-all -DRMLUI_SVG_PLUGIN=OFF -Wdev -Werror=dev -DRMLUI_WARNINGS_AS_ERRORS=ON
${{ matrix.cmake_options }}
- name: Build
working-directory: ${{github.workspace}}/Build
run: cmake --build . --config $BUILD_TYPE
run: cmake --build Build

- name: Test
if: ${{ matrix.enable_testing }}
working-directory: ${{github.workspace}}/Build
run: ctest -C $BUILD_TYPE
run: ctest


Linux-legacy:
Expand All @@ -69,33 +64,58 @@ jobs:
include:
- cc: clang
cxx: clang++
cmake_options: -DENABLE_PRECOMPILED_HEADERS=OFF -DSAMPLES_BACKEND=GLFW_GL2
cmake_options: -DRMLUI_BACKEND=GLFW_GL2 -DCMAKE_BUILD_TYPE=Debug
- cc: clang
cxx: clang++
cmake_options: -DBUILD_TESTING=ON -DSAMPLES_BACKEND=SDL_VK -DCMAKE_BUILD_TYPE=Debug
cmake_options: -DRMLUI_BACKEND=SDL_VK -DBUILD_TESTING=ON -DRMLUI_PRECOMPILED_HEADERS=OFF
- cmake_options: -DBUILD_TESTING=ON
- cmake_options: -DSAMPLES_BACKEND=SDL_VK -DRMLUI_VK_DEBUG=ON -DENABLE_PRECOMPILED_HEADERS=OFF -DCMAKE_BUILD_TYPE=Debug
- cmake_options: -DRMLUI_BACKEND=native -DCMAKE_BUILD_TYPE=Debug -DRMLUI_VK_DEBUG=ON

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Dependencies
run: |-
sudo apt-get update
sudo apt-get install cmake ninja-build libsdl2-dev libsdl2-image-dev libfreetype6-dev libglew-dev liblua5.2-dev libglfw3-dev
- name: Install Dependencies
run: |-
sudo apt-get update
sudo apt-get install cmake ninja-build libsdl2-dev libsdl2-image-dev libfreetype6-dev libharfbuzz-dev libglew-dev liblua5.2-dev libglfw3-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/Build
- name: Configure CMake
run: >-
cmake -B Build -G Ninja --preset samples-all -DRMLUI_SVG_PLUGIN=OFF -DRMLUI_LOTTIE_PLUGIN=OFF -Wdev -Werror=dev -DRMLUI_WARNINGS_AS_ERRORS=ON
${{ matrix.cmake_options }}
- name: Build
run: cmake --build Build


macOS:
runs-on: macos-latest

env:
BUILD_TYPE: Release

strategy:
fail-fast: false
matrix:
include:
- cmake_options: -DRMLUI_BACKEND=auto
- cmake_options: -DRMLUI_BACKEND=GLFW_GL2

steps:
- uses: actions/checkout@v4

- name: Install Dependencies
run: brew install lua sdl2 sdl2_image glfw

- name: Configure CMake
working-directory: ${{github.workspace}}/Build
run: >-
cmake $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON
cmake -B Build --preset samples -Wdev -Werror=dev -DRMLUI_WARNINGS_AS_ERRORS=ON
-DCMAKE_CXX_FLAGS="-DGL_SILENCE_DEPRECATION"
-DRMLUI_LUA_BINDINGS=ON
${{ matrix.cmake_options }}
- name: Build
working-directory: ${{github.workspace}}/Build
run: cmake --build . --config $BUILD_TYPE
run: cmake --build Build


Windows:
Expand All @@ -109,35 +129,59 @@ jobs:
fail-fast: false
matrix:
include:
- cmake_options: -DSAMPLES_BACKEND=auto -DENABLE_PRECOMPILED_HEADERS=OFF
- cmake_options: -DSAMPLES_BACKEND=Win32_VK -DRMLUI_VK_DEBUG=ON
- cmake_options: -DSAMPLES_BACKEND=SDL_VK -DBUILD_LUA_BINDINGS_FOR_LUAJIT=ON
- cmake_options: -DRMLUI_BACKEND=auto -DRMLUI_PRECOMPILED_HEADERS=OFF
- cmake_options: -DRMLUI_BACKEND=Win32_VK -DRMLUI_VK_DEBUG=ON
- cmake_options: -DRMLUI_BACKEND=SDL_VK -DRMLUI_LUA_BINDINGS_LIBRARY=luajit

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Dependencies
run: C:\vcpkg\vcpkg install freetype[core] sdl2[core,vulkan] lua[core] luajit

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/Build
run: C:\vcpkg\vcpkg install freetype[core] sdl2[core,vulkan] glfw3 lua[core] luajit

- name: Configure CMake
working-directory: ${{github.workspace}}/Build
run: >-
cmake $env:GITHUB_WORKSPACE -A x64 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON
-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
${{ matrix.cmake_options }}
cmake -B Build --preset samples -Wdev -Werror=dev -DBUILD_SHARED_LIBS=ON
-DRMLUI_LUA_BINDINGS=ON -DRMLUI_WARNINGS_AS_ERRORS=ON
-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ${{ matrix.cmake_options }}
- name: Build
working-directory: ${{github.workspace}}/Build
run: cmake --build . --config $env:BUILD_TYPE
run: cmake --build Build --config $env:BUILD_TYPE


MinGW64:
runs-on: windows-latest

env:
CHERE_INVOKING: yes
MSYSTEM: MINGW64

steps:
- uses: actions/checkout@v4

- name: Install Dependencies
run: |-
C:\msys64\usr\bin\bash -lc ("pacman --needed --noconfirm --sync " +
"mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-freetype mingw-w64-x86_64-lua " +
"mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-glew")
- name: Configure CMake
run: |-
C:\msys64\usr\bin\bash -lc ("cmake -B Build --preset samples -Wdev -Werror=dev -DCMAKE_BUILD_TYPE=Release " +
"-DBUILD_SHARED_LIBS=ON -DRMLUI_PRECOMPILED_HEADERS=OFF -DRMLUI_WARNINGS_AS_ERRORS=ON " +
"-DRMLUI_BACKEND=SDL_GL3 -DRMLUI_LUA_BINDINGS=ON")
- name: Build
run: C:\msys64\usr\bin\bash -lc "cmake --build Build"

- name: List files
run: C:\msys64\usr\bin\bash -lc "ls Build/*.{exe,dll} -s -h -X"


Emscripten:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Dependencies
run: |-
Expand All @@ -149,17 +193,15 @@ jobs:
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest
- name: Create Build Environment
run: cmake -E make_directory Build

- name: Configure CMake
run: |-
source emsdk-master/emsdk_env.sh
cd Build
emcmake cmake $GITHUB_WORKSPACE -DBUILD_SAMPLES=ON -DBUILD_SHARED_LIBS=OFF -DWARNINGS_AS_ERRORS=ON -DEMSCRIPTEN_EXE_FLAGS="-O1"
emcmake cmake -B Build --preset samples -Wdev -Werror=dev -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF -DRMLUI_WARNINGS_AS_ERRORS=ON \
-DCMAKE_MODULE_PATH=$GITHUB_WORKSPACE/CMake/Modules/Emscripten
- name: Build
run: |-
source emsdk-master/emsdk_env.sh
cd Build
emmake make -j4
emmake make -j
Loading

0 comments on commit 2354ef7

Please sign in to comment.