mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 10:59:00 +08:00
commit
2e7896e89e
25
ports/sdl2-net/CMakeLists.txt
Normal file
25
ports/sdl2-net/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(SDL2_NET C)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244 /wd4996")
|
||||
|
||||
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
|
||||
find_library(SDL_LIBRARY SDL2)
|
||||
|
||||
add_library(SDL2_net SDLnet.c SDLnetselect.c SDLnetTCP.c SDLnetUDP.c)
|
||||
|
||||
target_compile_definitions(SDL2_net PRIVATE _WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
target_include_directories(SDL2_net PRIVATE ${SDL_INCLUDE_DIR}/SDL2)
|
||||
target_link_libraries(SDL2_net ${SDL_LIBRARY} ws2_32 iphlpapi)
|
||||
|
||||
install(TARGETS SDL2_net
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib)
|
||||
|
||||
if(NOT DEFINED SDL_NET_SKIP_HEADERS)
|
||||
install(FILES SDL_net.h DESTINATION include/SDL2)
|
||||
endif()
|
||||
|
||||
message(STATUS "Link-time dependencies:")
|
||||
message(STATUS " " ${SDL_LIBRARY})
|
4
ports/sdl2-net/CONTROL
Normal file
4
ports/sdl2-net/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: sdl2-net
|
||||
Version: 2.0.1
|
||||
Description: Networking library for SDL
|
||||
Build-Depends: sdl2
|
22
ports/sdl2-net/portfile.cmake
Normal file
22
ports/sdl2-net/portfile.cmake
Normal file
@ -0,0 +1,22 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2_net-2.0.1)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz"
|
||||
FILENAME "SDL2_net-2.0.1.tar.gz"
|
||||
SHA512 d27faee3cddc3592dae38947e6c1df0cbaa95f82fde9c87db6d11f6312d868cea74f6830ad07ceeb3d0d75e9424cebf39e54fddf9a1147e8d9e664609de92b7a)
|
||||
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DSDL_NET_SKIP_HEADERS=ON)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-net)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-net/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-net/copyright)
|
Loading…
Reference in New Issue
Block a user