diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d3c209d7f3..42fc63f95e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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 @@ -20,7 +20,6 @@ jobs: brew update brew install cmake brew install ninja - brew install pkg-config brew install llvm - name: Cache Vcpkg @@ -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 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 634bd692de..d8e7f62bef 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -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 @@ -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 \ @@ -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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7821c2254b..15fe3b1dfe 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 @@ -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 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index f6060d2c9a..07dfd89647 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/cmake/arm64-osx-tactile.cmake b/cmake/arm64-osx-tactile.cmake new file mode 100644 index 0000000000..5c2f971dff --- /dev/null +++ b/cmake/arm64-osx-tactile.cmake @@ -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 () \ No newline at end of file diff --git a/cmake/x64-linux-tactile.cmake b/cmake/x64-linux-tactile.cmake new file mode 100644 index 0000000000..d8d0625477 --- /dev/null +++ b/cmake/x64-linux-tactile.cmake @@ -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 () \ No newline at end of file diff --git a/cmake/x64-osx-tactile.cmake b/cmake/x64-osx-tactile.cmake new file mode 100644 index 0000000000..ec8c833bfe --- /dev/null +++ b/cmake/x64-osx-tactile.cmake @@ -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 () \ No newline at end of file diff --git a/cmake/x64-windows-tactile.cmake b/cmake/x64-windows-tactile.cmake new file mode 100644 index 0000000000..dbb87eaf79 --- /dev/null +++ b/cmake/x64-windows-tactile.cmake @@ -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 () \ No newline at end of file diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 4d9d0eff10..c7540a352e 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -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 diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 565a11d15c..be9d35b317 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -38,7 +38,8 @@ target_link_libraries(${TACTILE_CORE_TARGET} Boost::boost FastFloat::fast_float ZLIB::ZLIB - $,zstd::libzstd_shared,zstd::libzstd_static> + zstd::libzstd_static + SDL2::SDL2 ) if (TACTILE_BUILD_TESTS MATCHES ON) diff --git a/modules/editor/CMakeLists.txt b/modules/editor/CMakeLists.txt index 2eec7a70cd..c901b68f07 100644 --- a/modules/editor/CMakeLists.txt +++ b/modules/editor/CMakeLists.txt @@ -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" ) diff --git a/modules/tmj-format/CMakeLists.txt b/modules/tmj-format/CMakeLists.txt index 4d21331d55..10b6c9050b 100644 --- a/modules/tmj-format/CMakeLists.txt +++ b/modules/tmj-format/CMakeLists.txt @@ -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