mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-15 16:29:03 +08:00
37240bfebf
* [raylib] Update to 4.0.0 * [raylib] Update version files
88 lines
2.5 KiB
CMake
88 lines
2.5 KiB
CMake
# https://github.com/raysan5/raylib/issues/388
|
|
vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
|
|
|
|
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" SHARED)
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC)
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
hidpi SUPPORT_HIGH_DPI
|
|
use-audio USE_AUDIO
|
|
)
|
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
|
set(DEBUG_ENABLE_SANITIZERS OFF)
|
|
else()
|
|
set(DEBUG_ENABLE_SANITIZERS ON)
|
|
endif()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
OPTIONS
|
|
-DBUILD_EXAMPLES=OFF
|
|
-DBUILD_GAMES=OFF
|
|
-DSHARED=${SHARED}
|
|
-DSTATIC=${STATIC}
|
|
-DUSE_EXTERNAL_GLFW=OFF # externl glfw3 causes build errors on Windows
|
|
${FEATURE_OPTIONS}
|
|
OPTIONS_DEBUG
|
|
-DENABLE_ASAN=${DEBUG_ENABLE_SANITIZERS}
|
|
-DENABLE_UBSAN=${DEBUG_ENABLE_SANITIZERS}
|
|
-DENABLE_MSAN=OFF
|
|
OPTIONS_RELEASE
|
|
-DENABLE_ASAN=OFF
|
|
-DENABLE_UBSAN=OFF
|
|
-DENABLE_MSAN=OFF
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
|
|
|
|
configure_file(
|
|
${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake
|
|
${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake
|
|
@ONLY
|
|
)
|
|
|
|
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()
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY)
|
|
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
|
|
|
|
vcpkg_fixup_pkgconfig()
|