mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
Switch to vcpkg
for library dependencies
This commit is contained in:
parent
7fee89d1f5
commit
22271d146a
4 changed files with 97 additions and 6 deletions
13
.github/workflows/continuous_integration.yml
vendored
13
.github/workflows/continuous_integration.yml
vendored
|
@ -13,19 +13,19 @@ jobs:
|
|||
- {
|
||||
name: "Visual Studio 2022",
|
||||
os: windows-2022,
|
||||
extra_options: "-A x64",
|
||||
extra_options: "-A x64 -DCMAKE_TOOLCHAIN_FILE=build/vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
build_type: "Release"
|
||||
}
|
||||
- {
|
||||
name: "Visual Studio 2019",
|
||||
os: windows-2019,
|
||||
extra_options: "-A x64",
|
||||
extra_options: "-A x64 -DCMAKE_TOOLCHAIN_FILE=build/vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
build_type: "Release"
|
||||
}
|
||||
- {
|
||||
name: "Visual Studio 2019",
|
||||
os: windows-2019,
|
||||
extra_options: "-A x64",
|
||||
extra_options: "-A x64 -DCMAKE_TOOLCHAIN_FILE=build/vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
build_type: "Debug"
|
||||
}
|
||||
- {
|
||||
|
@ -91,6 +91,13 @@ jobs:
|
|||
tar -xf "${ZMUSIC_PACKAGE}"
|
||||
fi
|
||||
|
||||
- name: Setup vcpkg
|
||||
uses: lukka/run-vcpkg@v11
|
||||
if: runner.os == 'Windows'
|
||||
with:
|
||||
vcpkgDirectory: '${{ github.workspace }}/build/vcpkg'
|
||||
vcpkgGitCommitId: '65c013b9667ff1f58fb8724209227e5a2e761043'
|
||||
|
||||
- name: Configure
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
|
@ -16,8 +16,33 @@ if( COMMAND cmake_policy )
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (LIBVPX_VCPKG)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "vcpkg-libvpx")
|
||||
endif()
|
||||
|
||||
if (OPENAL_SOFT_VCPKG)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "vcpkg-openal-soft")
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows"))
|
||||
# Force static triplet on Windows
|
||||
set(VCPKG_TARGET_TRIPLET "x64-windows-static")
|
||||
endif()
|
||||
|
||||
project(GZDoom)
|
||||
|
||||
if (WIN32 AND VCPKG_TOOLCHAIN)
|
||||
option(LIBVPX_VCPKG "Use libvpx from vcpkg" OFF)
|
||||
endif()
|
||||
|
||||
if (VCPKG_TOOLCHAIN)
|
||||
option(OPENAL_SOFT_VCPKG "Use OpenAL from vcpkg" OFF)
|
||||
endif()
|
||||
|
||||
if (NOT VCPKG_TOOLCHAIN)
|
||||
set(VCPKG_MANIFEST_FEATURES)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
|
|
@ -139,7 +139,11 @@ else()
|
|||
endif()
|
||||
|
||||
if( NOT NO_OPENAL )
|
||||
if ( NOT DYN_OPENAL ) # DYN_OPENAL uses local copies of the headers.
|
||||
if ( "vcpkg-openal-soft" IN_LIST VCPKG_MANIFEST_FEATURES )
|
||||
# Statically link to OpenAL from vcpkg
|
||||
find_package( OpenAL CONFIG REQUIRED )
|
||||
list( APPEND PROJECT_LIBRARIES OpenAL::OpenAL )
|
||||
elseif ( NOT DYN_OPENAL ) # DYN_OPENAL uses local copies of the headers.
|
||||
find_package( OpenAL )
|
||||
mark_as_advanced(CLEAR OPENAL_INCLUDE_DIR)
|
||||
if( OPENAL_INCLUDE_DIR )
|
||||
|
@ -300,7 +304,7 @@ if( UNIX )
|
|||
add_definitions( -DNO_CLOCK_GETTIME )
|
||||
endif()
|
||||
else()
|
||||
set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} rt )
|
||||
list( APPEND PROJECT_LIBRARIES rt )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -317,7 +321,7 @@ add_custom_target( revision_check ALL
|
|||
|
||||
set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${CMAKE_DL_LIBS}" "${DRPC_LIBRARIES}")
|
||||
if (HAVE_VULKAN)
|
||||
set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "zvulkan")
|
||||
list( APPEND PROJECT_LIBRARIES "zvulkan" )
|
||||
endif()
|
||||
|
||||
# ZMUSIC
|
||||
|
@ -1360,6 +1364,10 @@ add_custom_command(TARGET zdoom POST_BUILD
|
|||
${CMAKE_SOURCE_DIR}/fm_banks/gs-by-papiezak-and-sneakernets.wopn $<TARGET_FILE_DIR:zdoom>/fm_banks/gs-by-papiezak-and-sneakernets.wopn
|
||||
)
|
||||
|
||||
if (VCPKG_TOOLCHAIN)
|
||||
x_vcpkg_install_local_dependencies(TARGETS zdoom DESTINATION ".")
|
||||
endif()
|
||||
|
||||
if( WIN32 )
|
||||
set( INSTALL_SOUNDFONT_PATH . CACHE STRING "Directory where soundfonts and WOPL/WOPN banks will be placed during install." )
|
||||
else()
|
||||
|
|
51
vcpkg.json
Normal file
51
vcpkg.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||
"builtin-baseline": "9d47b24eacbd1cd94f139457ef6cd35e5d92cc84",
|
||||
"features":
|
||||
{
|
||||
"vcpkg-libvpx":
|
||||
{
|
||||
"description": "Use libvpx provided by vcpkg on Windows",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "libvpx",
|
||||
"default-features": false,
|
||||
"platform": "windows & static & staticcrt"
|
||||
}
|
||||
]
|
||||
},
|
||||
"vcpkg-openal-soft":
|
||||
{
|
||||
"description": "Use openal-soft provided by vcpkg.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openal-soft",
|
||||
"default-features": false,
|
||||
"platform": "!windows | (windows & static & staticcrt)"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "zlib",
|
||||
"platform": "!windows | (windows & static & staticcrt)"
|
||||
},
|
||||
{
|
||||
"name": "libjpeg-turbo",
|
||||
"platform": "!windows | (windows & static & staticcrt)"
|
||||
},
|
||||
{
|
||||
"name": "bzip2",
|
||||
"platform": "!windows | (windows & static & staticcrt)"
|
||||
},
|
||||
{
|
||||
"name": "sdl2",
|
||||
"platform": "!windows & !osx"
|
||||
},
|
||||
{
|
||||
"name": "libvpx",
|
||||
"platform": "!windows"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue