mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-10-23 03:26:59 +09:00
* feat: move amnezia hardcode from sources to cmake * feat: move amnezia hardcode from sources to cmake * refactor: remove prem v1 migration * chore: move more branding * fix: use host-matching architecture for iOS simulator builds x86_64 was hardcoded; Apple Silicon Macs run arm64 simulators and Xcode 26 has no Rosetta simulator destinations, so simulators showed as unsupported. * fix: mark the branded media assets catalog as a bundle resource MACOSX_PACKAGE_LOCATION was set on the upstream Media.xcassets path while target_sources uses CLIENT_IOS_MEDIA_ASSETS_PATH, so a branded catalog was never compiled by actool and the app got a blank icon. * fix: parametrize the Swift app-group identifier used by Log.swift Log.swift hardcoded Amnezia's own app-group instead of the branded one, since Swift -D flags can't carry the string value like the ObjC++ side does. Generate a small Swift constants file instead, same pattern as version.h.in, wired into all four targets that compile Log.swift. * fix: use APPLICATION_NAME instead of hardcoded Amnezia in log line format Every log line printed "Amnezia" regardless of branding; the log file name two lines above this already used APPLICATION_NAME correctly. * fix: restore branding fixes dropped by rebase, rename swiftInterop to swiftBridge * fix: move more branding variables to cmake * feat: move macOS branding from sources to cmake - macos/app/Info.plist.in: app group, camera usage text, UTI ids and descriptions now come from CLIENT_APPLICATION_NAME / BUILD_* variables, mirroring ios/app/Info.plist.in - macos/networkextension/Info.plist.in: bundle names and app group ids are templated; the plist is configured by CMake into the binary dir because Xcode only expands its own $(...) settings - new knobs: CLIENT_MACOS_MEDIA_ASSETS_PATH, CLIENT_MACOS_APP_ICNS_PATH, CLIENT_MACOS_PROVISIONING_PROFILE_SPECIFIER(_DEBUG), CLIENT_MACOS_NE_PROVISIONING_PROFILE_SPECIFIER(_DEBUG) * fix: resolve macOS pf template paths relative to the client source dir CMAKE_SOURCE_DIR points at the wrapper project when the client is built as a subproject, so the pf template lookup failed there. * chore: separate brandings defaults --------- Co-authored-by: vkamn <vk@amnezia.org>
86 lines
2.6 KiB
CMake
86 lines
2.6 KiB
CMake
cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(PROJECT AmneziaVPN)
|
|
if(NOT AMNEZIAVPN_VERSION)
|
|
set(AMNEZIAVPN_VERSION 5.0.1.1 CACHE STRING "Client app version")
|
|
endif()
|
|
|
|
set(QT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP ON CACHE BOOL "" FORCE)
|
|
set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES
|
|
${CMAKE_SOURCE_DIR}/cmake/platform_settings.cmake
|
|
${CMAKE_SOURCE_DIR}/cmake/recipes_bootstrap.cmake
|
|
${CMAKE_SOURCE_DIR}/cmake/conan_provider.cmake
|
|
CACHE STRING "" FORCE)
|
|
|
|
project(${PROJECT} VERSION ${AMNEZIAVPN_VERSION}
|
|
DESCRIPTION "AmneziaVPN"
|
|
HOMEPAGE_URL "https://amnezia.org/"
|
|
)
|
|
|
|
# trigger conan to kick off `conan install` globally
|
|
find_package(OpenSSL REQUIRED)
|
|
if (PREBUILTS_ONLY)
|
|
return()
|
|
endif()
|
|
|
|
string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
|
|
set(RELEASE_DATE "${CURRENT_DATE}")
|
|
|
|
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
|
|
|
|
# bump by 2 on every release, because we're releasing two versions on the play store
|
|
set(APP_ANDROID_VERSION_CODE 2148)
|
|
if(DEFINED APP_ANDROID_VERSION_CODE_OFFSET)
|
|
math(EXPR APP_ANDROID_VERSION_CODE "${APP_ANDROID_VERSION_CODE} + ${APP_ANDROID_VERSION_CODE_OFFSET}")
|
|
endif()
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
set(MZ_PLATFORM_NAME "linux")
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
set(MZ_PLATFORM_NAME "windows")
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
set(MZ_PLATFORM_NAME "macos")
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
|
|
set(MZ_PLATFORM_NAME "android")
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
|
|
set(MZ_PLATFORM_NAME "ios")
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
|
|
set(MZ_PLATFORM_NAME "wasm")
|
|
endif()
|
|
|
|
set(QT_BUILD_TOOLS_WHEN_CROSS_COMPILING ON)
|
|
|
|
if(APPLE AND NOT IOS)
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
set(AMN_PF_RULE_IDENTITY "user { root }")
|
|
else()
|
|
set(AMN_PF_RULE_IDENTITY "group { amnvpn }")
|
|
endif()
|
|
|
|
configure_file(
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/deploy/data/pf-templates/amn.400.allowPIA.conf.in"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/amn.400.allowPIA.conf"
|
|
@ONLY
|
|
)
|
|
|
|
file(COPY_FILE
|
|
"${CMAKE_CURRENT_BINARY_DIR}/amn.400.allowPIA.conf"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/deploy/data/macos/pf/amn.400.allowPIA.conf"
|
|
ONLY_IF_DIFFERENT
|
|
)
|
|
endif()
|
|
|
|
|
|
add_subdirectory(client)
|
|
|
|
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
|
|
add_subdirectory(service)
|
|
endif()
|
|
|
|
if ((LINUX AND NOT ANDROID) OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (WIN32))
|
|
include(${CMAKE_SOURCE_DIR}/cmake/CPack.cmake)
|
|
endif()
|