mirror of
https://github.com/CorsixTH/CorsixTH.git
synced 2025-07-23 12:23:05 +02:00
Merge pull request #2577 from tobylane/vcpkgmacos
Add cmake build options and macOS support to vcpkg
This commit is contained in:
@@ -34,15 +34,24 @@ option(BUILD_TOOLS "Build additional CLI tools (rnc_decode)" OFF)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
|
||||
|
||||
if(WITH_FREETYPE2)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "freetype")
|
||||
endif()
|
||||
if(WITH_AUDIO)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "audio")
|
||||
if(WITH_MOVIES)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "movies")
|
||||
endif()
|
||||
endif()
|
||||
if(BUILD_ANIMVIEW)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "animview")
|
||||
endif()
|
||||
if(WITH_UPDATE_CHECK)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "updatecheck")
|
||||
endif()
|
||||
if(ENABLE_UNIT_TESTS)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "catch2")
|
||||
endif()
|
||||
|
||||
project(CorsixTH_Top_Level)
|
||||
|
||||
|
@@ -60,6 +60,30 @@
|
||||
"VCPKG_TARGET_TRIPLET": "x86-windows",
|
||||
"ENABLE_UNIT_TESTS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "macos-arm64-rel",
|
||||
"binaryDir": "${sourceDir}/build/macos-arm64-rel",
|
||||
"generator": "Unix Makefiles",
|
||||
"cacheVariables": {
|
||||
"VCPKG_TARGET_TRIPLET": "arm64-osx-release",
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++",
|
||||
"CMAKE_MAKE_PROGRAM": "/usr/bin/make"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "macos-x64-rel",
|
||||
"binaryDir": "${sourceDir}/build/macos-arm64-rel",
|
||||
"generator": "Unix Makefiles",
|
||||
"cacheVariables": {
|
||||
"VCPKG_TARGET_TRIPLET": "x64-osx-release",
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++",
|
||||
"CMAKE_MAKE_PROGRAM": "/usr/bin/make"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
@@ -77,6 +101,16 @@
|
||||
"name": "win-x86-rel",
|
||||
"configurePreset": "win-x86-rel",
|
||||
"configuration": "RelWithDebInfo"
|
||||
},
|
||||
{
|
||||
"name": "macos-arm64-rel",
|
||||
"configurePreset": "macos-arm64-rel",
|
||||
"configuration": "RelWithDebInfo"
|
||||
},
|
||||
{
|
||||
"name": "macos-x64-rel",
|
||||
"configurePreset": "macos-x64-rel",
|
||||
"configuration": "RelWithDebInfo"
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
@@ -106,6 +140,24 @@
|
||||
"outputOnFailure": true
|
||||
},
|
||||
"configuration": "RelWithDebInfo"
|
||||
},
|
||||
{
|
||||
"name": "macos-arm64-rel",
|
||||
"configurePreset": "macos-arm64-rel",
|
||||
"output": {
|
||||
"verbosity": "extra",
|
||||
"outputOnFailure": true
|
||||
},
|
||||
"configuration": "RelWithDebInfo"
|
||||
},
|
||||
{
|
||||
"name": "macos-x64-rel",
|
||||
"configurePreset": "macos-x64-rel",
|
||||
"output": {
|
||||
"verbosity": "extra",
|
||||
"outputOnFailure": true
|
||||
},
|
||||
"configuration": "RelWithDebInfo"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -186,7 +186,7 @@ if(CORSIX_TH_USE_FFMPEG)
|
||||
if(APPLE)
|
||||
target_link_libraries(CorsixTH PRIVATE libz.dylib)
|
||||
# These LDFLAGS are necessary for static ffmpeg, harmless for dynamic ffmpeg
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-liconv -framework CoreVideo")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-liconv -framework CoreMedia -framework CoreVideo -framework VideoToolbox")
|
||||
endif()
|
||||
message(" FFmpeg found")
|
||||
else()
|
||||
|
33
vcpkg.json
33
vcpkg.json
@@ -1,17 +1,22 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"freetype",
|
||||
{
|
||||
"name": "lua",
|
||||
"features": [
|
||||
"tools"
|
||||
]
|
||||
},
|
||||
"luafilesystem",
|
||||
"lpeg",
|
||||
"sdl2",
|
||||
"luafilesystem",
|
||||
"lpeg"
|
||||
],
|
||||
"features": {
|
||||
"audio": {
|
||||
"description": "In game audio support",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "fluidsynth",
|
||||
"platform": "!osx",
|
||||
"features": [
|
||||
"sndfile"
|
||||
]
|
||||
@@ -20,15 +25,17 @@
|
||||
"name": "sdl2-mixer",
|
||||
"features": [
|
||||
"libmodplug",
|
||||
"fluidsynth",
|
||||
{
|
||||
"name": "fluidsynth",
|
||||
"platform": "!osx"
|
||||
},
|
||||
"libflac",
|
||||
"mpg123",
|
||||
"opusfile"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"catch2"
|
||||
],
|
||||
"features": {
|
||||
"animview": {
|
||||
"description": "Support building AnimView",
|
||||
"dependencies": [
|
||||
@@ -61,6 +68,18 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"freetype": {
|
||||
"description": "In game freetype font support",
|
||||
"dependencies": [
|
||||
"freetype"
|
||||
]
|
||||
},
|
||||
"catch2": {
|
||||
"description": "Support Catch2 tests",
|
||||
"dependencies": [
|
||||
"catch2"
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
|
Reference in New Issue
Block a user