Skip to content

Commit

Permalink
Merge pull request #1444 from dpogue/vcpkg-2023.07.21
Browse files Browse the repository at this point in the history
Update vcpkg to 2023.07.21
  • Loading branch information
dpogue authored Aug 4, 2023
2 parents 4e2ff6c + 4d30725 commit 83f53fb
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 21 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
steps:
- name: Checkout Plasma
uses: actions/checkout@v3
with:
submodules: true

- name: Checkout MaxSDK
continue-on-error: true
Expand Down Expand Up @@ -123,8 +121,6 @@ jobs:
steps:
- name: Checkout Plasma
uses: actions/checkout@v3
with:
submodules: true

- name: Checkout MaxSDK
uses: actions/checkout@v3
Expand Down Expand Up @@ -186,8 +182,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Install dependencies
run: |
Expand Down Expand Up @@ -254,8 +248,8 @@ jobs:
strategy:
matrix:
platform:
#- { str: macos-arm64, arch: arm64, triplet: arm64 }
- { str: macos-x64, arch: x86_64, triplet: x64 }
#- { str: macos-arm64, arch: arm64 }
- { str: macos-x64, arch: x86_64 }
cfg:
- { external: OFF, type: RelWithDebInfo, str: internal-release }
- { external: OFF, type: Debug, str: internal-debug }
Expand All @@ -264,8 +258,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Install dependencies
run: |
Expand Down Expand Up @@ -295,16 +287,13 @@ jobs:
cmake \
-G Xcode \
-DUSE_VCPKG=ON \
-DVCPKG_TARGET_TRIPLET="${{ matrix.platform.triplet}}-osx" \
-DVCPKG_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \
-DVCPKG_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DPLASMA_BUILD_TESTS=ON \
-DPLASMA_BUILD_TOOLS=ON \
-DPLASMA_EXTERNAL_RELEASE=${{ matrix.cfg.external }} \
${{ (matrix.platform.triplet == 'x64' && '-DQt5_ROOT=$(brew --prefix qt@5)') || '' }} \
${{ (matrix.platform.arch == 'x86_64' && '-DQt5_ROOT=$(brew --prefix qt@5)') || '' }} \
-DVCPKG_INSTALL_OPTIONS=--clean-after-build \
-S . -B build
env:
Expand Down
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
shallow = true
14 changes: 14 additions & 0 deletions Scripts/Triplets/arm64-macos-plasma.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_DISABLE_COMPILER_TRACKING TRUE)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.14")

# This is a terrible hack because meson seems to suck.
if(PORT STREQUAL cairo)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
endif()
15 changes: 15 additions & 0 deletions Scripts/Triplets/universal-macos-plasma.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set(VCPKG_TARGET_ARCHITECTURE x64 arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_DISABLE_COMPILER_TRACKING TRUE)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64 arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.14")

# This is a terrible hack because meson seems to suck.
if(PORT STREQUAL cairo)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
endif()

14 changes: 14 additions & 0 deletions Scripts/Triplets/x64-macos-plasma.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_DISABLE_COMPILER_TRACKING TRUE)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)
set(VCPKG_OSX_DEPLOYMENT_TARGET "10.14")

# This is a terrible hack because meson seems to suck.
if(PORT STREQUAL cairo)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
endif()
33 changes: 29 additions & 4 deletions cmake/VcpkgToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ string(ASCII ${_PLASMA_NUGET_TOKEN_ASCII} PLASMA_NUGET_TOKEN)
# pass in an arbitrary vcpkg toolchain if one is not specified in CMakeSettings.json. We don't want
# that either. Ugh, screw me.
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_NAME}" "Windows" _HOST_IS_WINDOWS)
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_NAME}" "Darwin" _HOST_IS_DARWIN)
option(USE_VCPKG "Use the vcpkg submodule for dependency management." ${_HOST_IS_WINDOWS})
if(NOT USE_VCPKG)
return()
Expand Down Expand Up @@ -44,9 +45,6 @@ if(_HOST_IS_WINDOWS OR EXISTS "${_VCPKG_MONO}")
set(ENV{VCPKG_BINARY_SOURCES} "$ENV{VCPKG_BINARY_SOURCES};nugetconfig,${_NUGET_CONFIG_PATH_NATIVE},read")
endif()

list(APPEND VCPKG_OVERLAY_PORTS "${CMAKE_SOURCE_DIR}/Scripts/Ports")
list(APPEND VCPKG_OVERLAY_TRIPLETS "${CMAKE_SOURCE_DIR}/Scripts/Triplets")

# Note that CMAKE_SIZEOF_VOID_P is currently undefined.
if(_HOST_IS_WINDOWS AND NOT DEFINED VCPKG_TARGET_TRIPLET)
if(CMAKE_GENERATOR_PLATFORM MATCHES "[Ww][Ii][Nn]32")
Expand All @@ -69,7 +67,34 @@ if(_HOST_IS_WINDOWS AND NOT DEFINED VCPKG_TARGET_TRIPLET)
endif()
endif()

# Default to using the same triplet for the host and target to prevent unnesecary
if(_HOST_IS_DARWIN AND NOT DEFINED VCPKG_TARGET_TRIPLET)
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(VCPKG_TARGET_TRIPLET "x64-macos-plasma" CACHE STRING "")
elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(VCPKG_TARGET_TRIPLET "arm64-macos-plasma" CACHE STRING "")
elseif(DEFINED CMAKE_OSX_ARCHITECTURES)
set(VCPKG_TARGET_TRIPLET "universal-macos-plasma" CACHE STRING "")
endif()

# CMAKE_HOST_SYSTEM_PROCESSOR is undefined at this point
execute_process(
COMMAND uname -m
OUTPUT_VARIABLE _HOST_SYSTEM_PROCESSOR
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(VCPKG_HOST_TRIPLET "x64-macos-plasma" CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "x64-macos-plasma" CACHE STRING "")
elseif(_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set(VCPKG_HOST_TRIPLET "arm64-macos-plasma" CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "arm64-macos-plasma" CACHE STRING "")
else()
message(FATAL_ERROR "Unknown architecture: '${_HOST_SYSTEM_PROCESSOR}' - set VCPKG_TARGET_TRIPLET manually.")
endif()
endif()

# Default to using the same triplet for the host and target to prevent unnecessary
# dependencies on cross-compilers when we're just building a Win32 static engine
# on a Win64 machine.
if(_HOST_IS_WINDOWS AND NOT DEFINED VCPKG_HOST_TRIPLET)
Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 911 files
19 changes: 18 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
},
"zlib"
],
"overrides": [
{
"name": "openssl",
"version": "3.0.8#2",
"$comment": "OpenSSL 3.1.x has a bug on arm64 macOS that causes crashes in debug builds. Use 3.0.x for now."
},
{
"name": "physx",
"version": "4.1.2#6",
"$comment": "Upstream vcpkg updated to PhysX 5, which drops support for several target platforms. Stick with 4.1.2 for now."
}
],
"features": {
"cairosvg": {
"description": "Installs a functional cairosvg Python module for the resource.dat generator.",
Expand All @@ -51,5 +63,10 @@
}
]
}
},
"builtin-baseline": "9d47b24eacbd1cd94f139457ef6cd35e5d92cc84",
"vcpkg-configuration": {
"overlay-ports": ["./Scripts/Ports"],
"overlay-triplets": ["./Scripts/Triplets"]
}
}
}

0 comments on commit 83f53fb

Please sign in to comment.