forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The toolchain is automatically picked up when CMAKE_SYSTEM_NAME equals iOS. The toolchain sets the architectures for which to build packages, as well as the processor type (because certain packages like libpng depend on their value). Automatic detection of triplets for iOS / tvOS / watchOS is added when using the vcpkg.cmake toolchain while building your own application. It uses the values of CMAKE_SYSTEM_NAME and CMAKE_OSX_ARCHITECTURES to detect the triplet. Fix (in a hacky way) find_package to find vcpkg installed packages. Reset the CMAKE_FIND_ROOT_PATH value, until upstream CMake removes its hardcoding of CMAKE_FIND_ROOT_PATH to Apple's SDK sysroot. Fixes: microsoft#6003
- Loading branch information
Showing
8 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
if(NOT _VCPKG_IOS_TOOLCHAIN) | ||
set(_VCPKG_IOS_TOOLCHAIN 1) | ||
|
||
if (VCPKG_TARGET_TRIPLET STREQUAL "arm64-ios") | ||
set(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "") | ||
set(CMAKE_SYSTEM_PROCESSOR aarch64) | ||
elseif(VCPKG_TARGET_TRIPLET STREQUAL "arm-ios") | ||
set(CMAKE_OSX_ARCHITECTURES arm CACHE STRING "") | ||
set(CMAKE_SYSTEM_PROCESSOR arm) | ||
elseif(VCPKG_TARGET_TRIPLET STREQUAL "x64-ios") | ||
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING "") | ||
elseif(VCPKG_TARGET_TRIPLET STREQUAL "x86-ios") | ||
set(CMAKE_OSX_ARCHITECTURES i386 CACHE STRING "") | ||
else() | ||
message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}") | ||
endif() | ||
|
||
set(CMAKE_SYSTEM_NAME iOS CACHE STRING "") | ||
|
||
get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) | ||
if(NOT _CMAKE_IN_TRY_COMPILE) | ||
string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ") | ||
string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ") | ||
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ") | ||
string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ") | ||
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ") | ||
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ") | ||
|
||
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") | ||
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(VCPKG_TARGET_ARCHITECTURE arm) | ||
set(VCPKG_CRT_LINKAGE dynamic) | ||
set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
set(VCPKG_CMAKE_SYSTEM_NAME iOS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
set(VCPKG_CRT_LINKAGE dynamic) | ||
set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
set(VCPKG_CMAKE_SYSTEM_NAME iOS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(VCPKG_TARGET_ARCHITECTURE x64) | ||
set(VCPKG_CRT_LINKAGE dynamic) | ||
set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
set(VCPKG_CMAKE_SYSTEM_NAME iOS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(VCPKG_TARGET_ARCHITECTURE x86) | ||
set(VCPKG_CRT_LINKAGE dynamic) | ||
set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
set(VCPKG_CMAKE_SYSTEM_NAME iOS) |