Add VCPKG_TARGET_IS_EMSCRIPTEN, fix opus and libsodium ports for wasm32-emscripten (#26318)

* vcpkg_common_definitions: Add VCPKG_TARGET_IS_EMSCRIPTEN

* [opus] Fix wasm32-emscripten builds

* [libsodium] Fix wasm32-emscripten builds

* Run x-add-version
This commit is contained in:
pastdue 2022-09-08 17:01:20 -04:00 committed by GitHub
parent 4cde015b16
commit 0e9a28874c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 5 deletions

View file

@ -5,7 +5,7 @@ The latest version of this document lives in the [vcpkg repo](https://github.com
This file defines the following variables which are commonly needed or used in portfiles:
```cmake
VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, MINGW, LINUX, OSX, ANDROID, FREEBSD, OPENBSD. only defined if <target>
VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, MINGW, LINUX, OSX, ANDROID, FREEBSD, OPENBSD, EMSCRIPTEN. only defined if <target>
VCPKG_HOST_IS_<host> with <host> being one of the following: WINDOWS, LINUX, OSX, FREEBSD, OPENBSD. only defined if <host>
VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "")
VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host

View file

@ -8,10 +8,15 @@ vcpkg_from_github(
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
if(VCPKG_TARGET_IS_EMSCRIPTEN)
set(ADDITIONAL_OPTIONS "-DENABLE_SSP=OFF")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
${ADDITIONAL_OPTIONS}
)
vcpkg_cmake_install()

View file

@ -1,7 +1,7 @@
{
"name": "libsodium",
"version": "1.0.18",
"port-version": 7,
"port-version": 8,
"description": "A modern and easy-to-use crypto library",
"homepage": "https://github.com/jedisct1/libsodium",
"license": "ISC",

View file

@ -16,6 +16,8 @@ if(VCPKG_TARGET_IS_MINGW)
set(STACK_PROTECTOR OFF)
string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0")
string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0")
elseif(VCPKG_TARGET_IS_EMSCRIPTEN)
set(STACK_PROTECTOR OFF)
else()
set(STACK_PROTECTOR ON)
endif()

View file

@ -1,7 +1,7 @@
{
"name": "opus",
"version": "1.3.1",
"port-version": 7,
"port-version": 8,
"description": "Totally open, royalty-free, highly versatile audio codec",
"homepage": "https://github.com/xiph/opus",
"license": "BSD-3-Clause",

View file

@ -20,6 +20,8 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW")
set(VCPKG_TARGET_IS_WINDOWS ON)
set(VCPKG_TARGET_IS_MINGW ON)
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(VCPKG_TARGET_IS_EMSCRIPTEN ON)
endif()
#Helper variables to identify the host system name

View file

@ -4126,7 +4126,7 @@
},
"libsodium": {
"baseline": "1.0.18",
"port-version": 7
"port-version": 8
},
"libsoundio": {
"baseline": "2.0.0",
@ -5414,7 +5414,7 @@
},
"opus": {
"baseline": "1.3.1",
"port-version": 7
"port-version": 8
},
"opusfile": {
"baseline": "0.12",

View file

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "72748d8d6030aac034e5b74229898016f833b33a",
"version": "1.0.18",
"port-version": 8
},
{
"git-tree": "9ffdf9b217021918c33311af9faa9b4a3086d004",
"version": "1.0.18",

View file

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f69aedcd28796dfac85514ee0934e7f91ab05e06",
"version": "1.3.1",
"port-version": 8
},
{
"git-tree": "ad2b9149564516603dab6b996af3d4bc7ba29017",
"version": "1.3.1",