forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sdl3] Adding port for SDL3 Pre-release (microsoft#40867)
Co-authored-by: Lily Wang <[email protected]>
- Loading branch information
1 parent
146dc54
commit 6046e48
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO libsdl-org/SDL | ||
REF "preview-3.1.6" | ||
SHA512 a0ca7263cd2f1b883829c39ae0ee2ea18d814f8dde768c8be9a49487193bc856bb45870764fd70169e75d2ec80457e5b45811c07a926479f1ac4f9d3157f40a4 | ||
HEAD_REF main | ||
) | ||
|
||
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_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
alsa SDL_ALSA | ||
ibus SDL_IBUS | ||
vulkan SDL_VULKAN | ||
wayland SDL_WAYLAND | ||
x11 SDL_X11 | ||
) | ||
|
||
if ("x11" IN_LIST FEATURES) | ||
message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n") | ||
endif() | ||
if ("wayland" IN_LIST FEATURES) | ||
message(WARNING "You will need to install Wayland dependencies to use feature wayland:\nsudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev\n") | ||
endif() | ||
if ("ibus" IN_LIST FEATURES) | ||
message(WARNING "You will need to install ibus dependencies to use feature ibus:\nsudo apt install libibus-1.0-dev\n") | ||
endif() | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
${FEATURE_OPTIONS} | ||
-DSDL_STATIC=${SDL_STATIC} | ||
-DSDL_SHARED=${SDL_SHARED} | ||
-DSDL_FORCE_STATIC_VCRT=${FORCE_STATIC_VCRT} | ||
-DSDL_LIBC=ON | ||
-DSDL_TEST_LIBRARY=OFF | ||
-DSDL_TESTS=OFF | ||
# Speficying the revision skips the need to use git to determine a version | ||
-DSDL_REVISION=SDL-${VERSION} | ||
MAYBE_UNUSED_VARIABLES | ||
SDL_FORCE_STATIC_VCRT | ||
) | ||
|
||
vcpkg_cmake_install() | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
vcpkg_cmake_config_fixup(CONFIG_PATH cmake) | ||
else() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SDL3) | ||
endif() | ||
|
||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
) | ||
|
||
vcpkg_copy_pdbs() | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sdl3 provides CMake targets: | ||
|
||
find_package(SDL3 CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE SDL3::SDL3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "sdl3", | ||
"version": "3.1.6-preview", | ||
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.", | ||
"homepage": "https://www.libsdl.org", | ||
"license": "Zlib", | ||
"supports": "!uwp", | ||
"dependencies": [ | ||
{ | ||
"name": "dbus", | ||
"default-features": false, | ||
"platform": "linux" | ||
}, | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"default-features": [ | ||
{ | ||
"name": "ibus", | ||
"platform": "linux" | ||
}, | ||
{ | ||
"name": "wayland", | ||
"platform": "linux" | ||
}, | ||
{ | ||
"name": "x11", | ||
"platform": "linux" | ||
} | ||
], | ||
"features": { | ||
"alsa": { | ||
"description": "Support for alsa audio", | ||
"dependencies": [ | ||
{ | ||
"name": "alsa", | ||
"platform": "linux" | ||
} | ||
] | ||
}, | ||
"ibus": { | ||
"description": "Build with ibus IME support", | ||
"supports": "linux" | ||
}, | ||
"vulkan": { | ||
"description": "Vulkan functionality for SDL" | ||
}, | ||
"wayland": { | ||
"description": "Build with Wayland support", | ||
"supports": "linux" | ||
}, | ||
"x11": { | ||
"description": "Build with X11 support", | ||
"supports": "!windows" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "13a8f95b66218cead5be81f83a049a7d4cc266f8", | ||
"version": "3.1.6-preview", | ||
"port-version": 0 | ||
} | ||
] | ||
} |