mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 08:57:55 +08:00
54 lines
1.9 KiB
CMake
54 lines
1.9 KiB
CMake
include(vcpkg_common_functions)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO SDL-Mirror/SDL
|
|
REF release-2.0.7
|
|
SHA512 3667c7299d007e0438de90c6dd1f19ad9f30cf155c35792c40267bc74f8fe8acd1046ac918a104690ccba3faa2dbd86b37821a38c6c389179359b903209e2eb7
|
|
HEAD_REF master
|
|
)
|
|
|
|
vcpkg_apply_patches(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PATCHES
|
|
${CMAKE_CURRENT_LIST_DIR}/export-symbols-only-in-shared-build.patch
|
|
${CMAKE_CURRENT_LIST_DIR}/enable-winrt-cmake.patch
|
|
)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SDL_SHARED)
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT)
|
|
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
OPTIONS
|
|
-DSDL_STATIC=${SDL_STATIC}
|
|
-DSDL_SHARED=${SDL_SHARED}
|
|
-DVIDEO_VULKAN=OFF
|
|
-DFORCE_STATIC_VCRT=${FORCE_STATIC_VCRT}
|
|
-DLIBC=ON
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")
|
|
|
|
if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib)
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib)
|
|
|
|
file(GLOB SHARE_FILES ${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake)
|
|
foreach(SHARE_FILE ${SHARE_FILES})
|
|
file(READ "${SHARE_FILE}" _contents)
|
|
string(REPLACE "lib/SDL2main" "lib/manual-link/SDL2main" _contents "${_contents}")
|
|
file(WRITE "${SHARE_FILE}" "${_contents}")
|
|
endforeach()
|
|
endif()
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2 RENAME copyright)
|
|
vcpkg_copy_pdbs()
|