Live copy of vcpkg patch for raylib
Published: 2022-02-22 21:50
This file is a copy of the portfile.cmake
file needed for patching vcpkg.
For more information, see the
main blog post
If you just want to download the file, click here
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
message("
###################################
# Patched by Martin E. Zahnd :) #
###################################
Patch notes:
- Removed DBUILD_GAMES, DSHARED, DSTATIC deprecated options. Replaced by DBUILD_SHARED_LIBS
- Removed ENABLE_ASAN, ENABLE_UBASAN, ENABLE_MSAN options. Could not build with them.
")
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX)
message(
"raylib currently requires the following libraries from the system package manager:
libgl1-mesa-dev
libx11-dev
libxcursor-dev
libxinerama-dev
libxrandr-dev
These can be installed on Ubuntu systems via sudo apt install libgl1-mesa-dev libx11-dev libxcursor-dev libxinerama-dev libxrandr-dev"
)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO raysan5/raylib
REF 4.0.0
SHA512 e9ffab14ab902e3327202e68ca139209ff24100dab62eb03fef50adf363f81e2705d81e709c58cf1514e68e6061c8963555bd2d00744daacc3eb693825fc3417
HEAD_REF master
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_USING_SHARED_LIBS)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
hidpi SUPPORT_HIGH_DPI
use-audio USE_AUDIO
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_EXAMPLES=OFF
-DBUILD_SHARED_LIBS=${BUILD_USING_SHARED_LIBS}
-DUSE_EXTERNAL_GLFW=OFF # externl glfw3 causes build errors on Windows
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
vcpkg_replace_string(
${CURRENT_PACKAGES_DIR}/include/raylib.h
"defined(USE_LIBTYPE_SHARED)"
"1 // defined(USE_LIBTYPE_SHARED)"
)
endif()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)