diff --git a/CMakeLists.txt b/CMakeLists.txt index bddbed61..decdd165 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,8 +34,14 @@ option(BUILD_TOOLS "Build additional CLI tools (rnc_decode)" OFF) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake) -if(WITH_MOVIES) - list(APPEND VCPKG_MANIFEST_FEATURES "movies") +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") @@ -43,6 +49,9 @@ 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) diff --git a/CMakePresets.json b/CMakePresets.json index 411608b7..e109a959 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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" } ] } diff --git a/CorsixTH/CMakeLists.txt b/CorsixTH/CMakeLists.txt index d0b099f6..e7cccf5a 100644 --- a/CorsixTH/CMakeLists.txt +++ b/CorsixTH/CMakeLists.txt @@ -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() diff --git a/vcpkg.json b/vcpkg.json index 08eab65c..8a0041ba 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,34 +1,41 @@ { "dependencies": [ - "freetype", { "name": "lua", "features": [ "tools" ] }, - "luafilesystem", - "lpeg", "sdl2", - { - "name": "fluidsynth", - "features": [ - "sndfile" - ] - }, - { - "name": "sdl2-mixer", - "features": [ - "libmodplug", - "fluidsynth", - "libflac", - "mpg123", - "opusfile" - ] - }, - "catch2" + "luafilesystem", + "lpeg" ], "features": { + "audio": { + "description": "In game audio support", + "dependencies": [ + { + "name": "fluidsynth", + "platform": "!osx", + "features": [ + "sndfile" + ] + }, + { + "name": "sdl2-mixer", + "features": [ + "libmodplug", + { + "name": "fluidsynth", + "platform": "!osx" + }, + "libflac", + "mpg123", + "opusfile" + ] + } + ] + }, "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": [