Skip to content

Commit

Permalink
Add custom Vcpkg triplet files
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Oct 25, 2023
1 parent f8ee6f3 commit de6f90a
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ push ]

env:
VCPKG_ROOT: ${{github.workspace}}/vcpkg
VCPKG_TARGET_TRIPLET: x64-osx-dynamic
VCPKG_TARGET_TRIPLET: x64-osx-tactile
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/vcpkg/bincache
VCPKG_CACHE_EDITION: 1

Expand All @@ -20,7 +20,6 @@ jobs:
brew update
brew install cmake
brew install ninja
brew install pkg-config
brew install llvm
- name: Cache Vcpkg
Expand All @@ -45,6 +44,9 @@ jobs:
if: steps.restore-vcpkg-and-artifacts.outputs.cache-hit != 'true'
run: mkdir -p ${{env.VCPKG_DEFAULT_BINARY_CACHE}}

- name: Register custom Vcpkg triplet file
run: cp "cmake/x64-osx-tactile.cmake" "$VCPKG_ROOT/triplets/x64-osx-tactile.cmake"

- name: Generate build files
run: |
mkdir build && cd build
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
DISPLAY: :99.0
SDL_VIDEODRIVER: x11
VCPKG_ROOT: ${{github.workspace}}/vcpkg
VCPKG_TARGET_TRIPLET: x64-linux-tactile
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/vcpkg/bincache
VCPKG_CACHE_EDITION: 1

Expand Down Expand Up @@ -53,6 +54,9 @@ jobs:
if: steps.restore-vcpkg-and-artifacts.outputs.cache-hit != 'true'
run: mkdir -p ${{env.VCPKG_DEFAULT_BINARY_CACHE}}

- name: Register custom Vcpkg triplet file
run: cp "cmake/x64-linux-tactile.cmake" "$VCPKG_ROOT/triplets/x64-linux-tactile.cmake"

- name: Emulate video device
run: |
/sbin/start-stop-daemon --start \
Expand All @@ -69,6 +73,7 @@ jobs:
mkdir build && cd build
cmake .. -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TARGET_TRIPLET}} \
-DTACTILE_USE_SANITIZERS=OFF \
-DTACTILE_BUILD_TESTS=ON \
--log-level=DEBUG
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ push ]

env:
VCPKG_ROOT: ${{github.workspace}}\vcpkg
VCPKG_TARGET_TRIPLET: x64-windows
VCPKG_TARGET_TRIPLET: x64-windows-tactile
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}\vcpkg\bincache
VCPKG_CACHE_EDITION: 1

Expand Down Expand Up @@ -40,6 +40,10 @@ jobs:
if: steps.restore-vcpkg-and-artifacts.outputs.cache-hit != 'true'
run: mkdir -p ${{env.VCPKG_DEFAULT_BINARY_CACHE}}

- name: Register custom Vcpkg triplet file
run: Copy-Item -Path "cmake\x64-windows-tactile.cmake" `
-Destination "$ENV:VCPKG_ROOT\triplets\x64-windows-tactile.cmake"

- name: Generate build files
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.21)

if (DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
cmake_path(SET VCPKG_ROOT NORMALIZE $ENV{VCPKG_ROOT})
Expand Down
10 changes: 10 additions & 0 deletions cmake/arm64-osx-tactile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)

if (PORT MATCHES "sdl2|sdl2-image")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif ()
9 changes: 9 additions & 0 deletions cmake/x64-linux-tactile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)

if (PORT MATCHES "sdl2|sdl2-image")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif ()
10 changes: 10 additions & 0 deletions cmake/x64-osx-tactile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)

if (PORT MATCHES "sdl2|sdl2-image")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif ()
7 changes: 7 additions & 0 deletions cmake/x64-windows-tactile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

if (PORT MATCHES "sdl2|sdl2-image")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif ()
4 changes: 0 additions & 4 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ function(tactile_set_output_dir target directory)
)
endfunction()

function(tactile_use_plugin_output_dir target)
tactile_set_output_dir(${target} "${TACTILE_BUILD_DIR}/plugins")
endfunction()

function(tactile_copy_directory_post_build target from to)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
Expand Down
3 changes: 2 additions & 1 deletion modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ target_link_libraries(${TACTILE_CORE_TARGET}
Boost::boost
FastFloat::fast_float
ZLIB::ZLIB
$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>
zstd::libzstd_static
SDL2::SDL2
)

if (TACTILE_BUILD_TESTS MATCHES ON)
Expand Down
1 change: 0 additions & 1 deletion modules/editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(TACTILE_EDITOR_DIR "${TACTILE_ROOT_DIR}/modules/editor")
file(GLOB_RECURSE TACTILE_EDITOR_SOURCE_FILES
CONFIGURE_DEPENDS
"${TACTILE_EDITOR_DIR}/inc/**/*.hpp"
"${TACTILE_EDITOR_DIR}/src/**/*.hpp"
"${TACTILE_EDITOR_DIR}/src/**/*.cpp"
)

Expand Down
2 changes: 0 additions & 2 deletions modules/tmj-format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ add_library(${TACTILE_TMJ_FORMAT_TARGET} SHARED ${TACTILE_TMJ_FORMAT_SOURCE_FILE

tactile_prepare_target(${TACTILE_TMJ_FORMAT_TARGET})

tactile_use_plugin_output_dir(${TACTILE_TMJ_FORMAT_TARGET})

target_compile_definitions(${TACTILE_TMJ_FORMAT_TARGET}
PRIVATE
TACTILE_BUILDING_TMJ_PLUGIN
Expand Down

0 comments on commit de6f90a

Please sign in to comment.