Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake modernization #446

Merged
merged 29 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
deb90b7
CMake: Rename old CMakeLists.txt
hobyst Mar 13, 2023
104fdb3
CMake modernization
hobyst Apr 12, 2023
e1ff002
Various fixes
hobyst Sep 2, 2023
7ad098f
Output compiled DLLs and samples in same directory
hobyst Sep 2, 2023
12467e1
Refactor SFML handling
hobyst Sep 3, 2023
a866f82
Use IMPORTED targets for handled external dependencies
hobyst Sep 3, 2023
95f94a8
Put utility CMake functions in a separate file
hobyst Sep 4, 2023
962bfd1
Implement enumerated lists for option selection
hobyst Sep 6, 2023
6304d18
Add bitmapfont sample
hobyst Sep 6, 2023
d75db75
CI: Change Ubuntu version and fix SDL issues
hobyst Sep 7, 2023
fd3a5ab
Clean up of older build pipeline files
hobyst Sep 8, 2023
27a12a1
Add comments to some CMake files
hobyst Sep 8, 2023
94131f2
Add rules to CONTRIBUTING.md and apply them
hobyst Sep 9, 2023
c77605a
Various changes
hobyst Sep 9, 2023
a65abdc
Prevent target collision on Emscripten modules
hobyst Sep 10, 2023
62f28e7
Remove SDK notice due to not found native libs
hobyst Sep 11, 2023
fa67257
Respect chosen runtime output directory
hobyst Sep 11, 2023
26da46f
Find SDL2 as soft dependency
hobyst Sep 11, 2023
ea46ed4
Accommodate automatic selection of samples backend
hobyst Sep 11, 2023
6b13b51
Clean up Tests directory
hobyst Sep 11, 2023
7286191
Use GLVND as preferred OpenGL ABI on Linux
hobyst Sep 11, 2023
17fc5d0
Correct logic for the Freetype pre-proc definition
hobyst Dec 2, 2023
a07be67
Change options names according to new convention
hobyst Dec 2, 2023
be27445
Correct SFML handling
hobyst Dec 2, 2023
52f459e
Change conditions for the Freetype MSVC warning
hobyst Dec 2, 2023
8e037f4
Change sample CMake target names
hobyst Dec 2, 2023
4f25480
Change handling of samples that require Freetype
hobyst Dec 2, 2023
fb1eabd
Move SDL_image find module for Ubuntu up a folder
hobyst Dec 2, 2023
6760b65
Remove mention of SFML <= 2.4 in comment
hobyst Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 49 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,42 @@ jobs:

env:
BUILD_TYPE: Release
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CC: "${{ matrix.cc }}"
CXX: "${{ matrix.cxx }}"

strategy:
fail-fast: false
matrix:
include:
- cc: clang
cxx: clang++
cmake_options: -DENABLE_PRECOMPILED_HEADERS=OFF -DSAMPLES_BACKEND=GLFW_GL2
cmake_options: -DRMLUI_ENABLE_PRECOMPILED_HEADERS=OFF -DRMLUI_SAMPLES_BACKEND=GLFW_GL2
- cc: clang
cxx: clang++
cmake_options: -DSAMPLES_BACKEND=SDL_VK
- cmake_options: -DBUILD_TESTING=ON -DENABLE_PRECOMPILED_HEADERS=OFF
cmake_options: -DRMLUI_SAMPLES_BACKEND=SDL_VK
- cmake_options: -DRMLUI_BUILD_TESTING=ON -DRMLUI_ENABLE_PRECOMPILED_HEADERS=OFF
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_LOTTIE_PLUGIN=ON -DRMLUI_SAMPLES_BACKEND=X11_GL2
- cmake_options: -DRMLUI_DISABLE_RTTI_AND_EXCEPTIONS=ON -DRMLUI_SAMPLES_BACKEND=SDL_GL2
- cmake_options: -DRMLUI_NO_THIRDPARTY_CONTAINERS=ON -DRMLUI_SAMPLES_BACKEND=SFML_GL2
- cmake_options: -DRMLUI_SAMPLES_BACKEND=SDL_VK -DRMLUI_VK_DEBUG=ON -DRMLUI_ENABLE_PRECOMPILED_HEADERS=OFF -DCMAKE_BUILD_TYPE=Debug

steps:
- uses: actions/checkout@v3

- 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
sudo apt update -yq
sudo apt install -yq cmake ninja-build clang 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

- 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 $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DRMLUI_BUILD_LUA_BINDINGS=ON -DRMLUI_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON
-DCMAKE_MODULE_PATH=$GITHUB_WORKSPACE/CMake/Modules/Linux
${{ matrix.cmake_options }}

- name: Build
Expand All @@ -65,8 +66,8 @@ jobs:
fail-fast: false
matrix:
include:
- cmake_options: -DSAMPLES_BACKEND=auto
- cmake_options: -DSAMPLES_BACKEND=GLFW_GL2
# - cmake_options: -DRMLUI_SAMPLES_BACKEND=auto
- cmake_options: -DRMLUI_SAMPLES_BACKEND=GLFW_GL2

steps:
- uses: actions/checkout@v3
Expand All @@ -80,7 +81,7 @@ jobs:
- name: Configure CMake
working-directory: ${{github.workspace}}/Build
run: >-
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DRMLUI_BUILD_LUA_BINDINGS=ON -DRMLUI_SAMPLES=ON -DWARNINGS_AS_ERRORS=ON
${{ matrix.cmake_options }}

- name: Build
Expand All @@ -99,57 +100,68 @@ 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_SAMPLES_BACKEND=auto -DRMLUI_ENABLE_PRECOMPILED_HEADERS=OFF
# After upgrading minimum CMake to >= 3.18, CMake should automatically find Vulkan using the VULKAN_SDK environment variable
- cmake_options: -DRMLUI_SAMPLES_BACKEND=Win32_VK -DRMLUI_VK_DEBUG=ON -DVulkan_LIBRARY="C:\VulkanSDK\1.3.250.1\Lib\vulkan-1.lib" -DVulkan_INCLUDE_DIR="C:\VulkanSDK\1.3.250.1\Include\vulkan"
- cmake_options: -DRMLUI_SAMPLES_BACKEND=SDL_VK -DRMLUI_BUILD_LUA_BINDINGS_FOR_LUAJIT=ON -DVulkan_LIBRARY="C:\VulkanSDK\1.3.250.1\Lib\vulkan-1.lib" -DVulkan_INCLUDE_DIR="C:\VulkanSDK\1.3.250.1\Include\vulkan"

steps:
- uses: actions/checkout@v3

- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.12.1

- name: Install Dependencies
run: C:\vcpkg\vcpkg install freetype[core] sdl2[core,vulkan] lua[core] luajit
run: |-
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.3.250.1/windows/VulkanSDK-1.3.250.1-Installer.exe -OutFile vulkansdk.exe
.\vulkansdk.exe --confirm-command --accept-licenses --default-answer in com.lunarg.vulkan
mikke89 marked this conversation as resolved.
Show resolved Hide resolved
C:\vcpkg\vcpkg install freetype[core] sdl2[core,vulkan] lua[core] luajit

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/Build

- 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 $env:GITHUB_WORKSPACE -A x64 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DRMLUI_BUILD_LUA_BINDINGS=ON -DRMLUI_SAMPLES=ON -DWARNINGS_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


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

- name: Install Dependencies
run: |-
sudo apt-get update
sudo apt-get install cmake
wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -xvf master.tar.gz
emsdk-master/emsdk update
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest

sudo apt update -yq
sudo apt install -yq cmake

- name: Install Emscripten SDK
run: |-
cd ~
git clone https://github.com/emscripten-core/emsdk.git --depth 1
cd emsdk
./emsdk install latest
./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"
source ~/emsdk/emsdk_env.sh
cmake -S . -B Build -DCMAKE_BUILD_TYPE=Debug -DRMLUI_SAMPLES=ON -DRMLUI_SAMPLES_BACKEND=SDL_GL3 \
-DBUILD_SHARED_LIBS=OFF -DWARNINGS_AS_ERRORS=ON -DRMLUI_EMSCRIPTEN_EXE_FLAGS="-O1" \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DCMAKE_MODULE_PATH=$GITHUB_WORKSPACE/CMake/Modules/Emscripten

- name: Build
working-directory: ${{github.workspace}}/Build
run: |-
source emsdk-master/emsdk_env.sh
cd Build
emmake make -j4
source ~/emsdk/emsdk_env.sh
cmake --build . --config $env:BUILD_TYPE
121 changes: 0 additions & 121 deletions CMake/BackendFileList.cmake

This file was deleted.

Loading