Skip to content

Commit ffc975f

Browse files
committed
Add overlay to disable JIT on iOS
1 parent db89632 commit ffc975f

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
vcpkg_from_github(
2+
OUT_SOURCE_PATH SOURCE_PATH
3+
REPO blend2d/blend2d
4+
REF d2027ebfd6aaf53b190b6b3b497425fc85f14251 # commited on 2025-03-08
5+
SHA512 f7ecda8280290a1692bbec618522eccf1d74f79c688affc687848459c06762e405ad2f319845a548d478723ed8bf8db609e4691bc335f364baceb20d9d3aa597
6+
HEAD_REF master
7+
)
8+
9+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BLEND2D_STATIC)
10+
11+
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
12+
INVERTED_FEATURES
13+
jit BLEND2D_NO_JIT
14+
)
15+
16+
# iOS will not allow us to use JIT, so we need to disable it in Blend2D.
17+
# Once we're using manifest mode for Unreal, we can get rid of this overlay port and use the above feature.
18+
if(IOS)
19+
set(IOS_DISABLE_JIT "-DBLEND2D_NO_JIT")
20+
endif()
21+
22+
vcpkg_cmake_configure(
23+
SOURCE_PATH "${SOURCE_PATH}"
24+
OPTIONS
25+
"-DBLEND2D_STATIC=${BLEND2D_STATIC}"
26+
"-DBLEND2D_NO_FUTEX=OFF"
27+
"-DBLEND2D_EXTERNAL_ASMJIT=ON"
28+
${IOS_DISABLE_JIT}
29+
${FEATURE_OPTIONS}
30+
)
31+
32+
vcpkg_cmake_install()
33+
vcpkg_copy_pdbs()
34+
35+
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
36+
37+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
38+
39+
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
40+
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/blend2d/api.h"
41+
"#if !defined(BL_STATIC)"
42+
"#if 0"
43+
)
44+
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/blend2d-debug.h"
45+
"#if defined(BL_STATIC)"
46+
"#if 1"
47+
)
48+
endif()
49+
50+
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
51+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
blend2d provides CMake targets:
2+
3+
find_package(blend2d CONFIG REQUIRED)
4+
target_link_libraries(main PRIVATE blend2d::blend2d)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "blend2d",
3+
"version-date": "2025-03-08",
4+
"description": "2D Vector Graphics Engine Powered by a JIT Compiler",
5+
"homepage": "https://github.com/blend2d/blend2d",
6+
"documentation": "https://blend2d.com/doc/index.html",
7+
"license": "Zlib",
8+
"supports": "!wasm32",
9+
"dependencies": [
10+
{
11+
"name": "vcpkg-cmake",
12+
"host": true
13+
},
14+
{
15+
"name": "vcpkg-cmake-config",
16+
"host": true
17+
}
18+
],
19+
"default-features": [
20+
{
21+
"name": "jit",
22+
"platform": "!arm32"
23+
}
24+
],
25+
"features": {
26+
"jit": {
27+
"description": "Enables JIT compiler to generate optimized pipelines.",
28+
"supports": "!arm32",
29+
"dependencies": [
30+
"asmjit"
31+
]
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)