Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
437 lines (384 loc) · 19.3 KB
/
Copy pathCMakeLists.txt
File metadata and controls
437 lines (384 loc) · 19.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# ------------------------------------------------------------------------------
# Windscribe Build System
# Copyright (c) 2020-2026, Windscribe Limited. All rights reserved.
# ------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.23)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # option() honors normal variables
# Set before project(): vcpkg's toolchain wraps find_package/add_executable/add_library, and those wrappers
# keep the policies in effect when the toolchain loads. CMP0167: find_package(Boost) uses BoostConfig.cmake.
# CMP0156: Apple's linker needs no repeated static libraries; Windows would also reorder its DLL import libs.
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
if(CMAKE_HOST_APPLE AND POLICY CMP0156)
cmake_policy(SET CMP0156 NEW)
endif()
# Set macOS deployment target and architecture before project()
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.4" CACHE STRING "Minimum OS X deployment version")
# Set the macOS architecture(s) BEFORE project() so the value is in effect when wsnet's targets are
# created during the FetchContent fetch below. wsnet is a SHARED lib (libwsnet.dylib) on macOS, and a
# target's architectures are captured from CMAKE_OSX_ARCHITECTURES at creation time; if it is still
# unset when wsnet is configured, wsnet builds for the host arch only and the universal CI link fails
# with "found architecture 'arm64', required architecture 'x86_64'". CI builds universal; a local
# build matches the host CPU. This is the single source of truth for the arch -- architectures.cmake
# only sets the build-libs path.
if(APPLE)
if(CI_MODE)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "macOS architectures" FORCE)
elseif(NOT DEFINED CMAKE_OSX_ARCHITECTURES)
execute_process(
COMMAND uname -m
OUTPUT_VARIABLE MACOS_HOST_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CMAKE_OSX_ARCHITECTURES "${MACOS_HOST_ARCH}" CACHE STRING "macOS architectures")
endif()
endif()
# Enable vcpkg dependency installation
set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
# C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# MSVC runtime library (static linkage)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# Windows target OS floor: pin to Windows 10 2004 (build 19041 / NTDDI_WIN10_VB) so every
# Windows target builds against the same minimum-supported-OS API surface. This provides a
# compile-time guard against accidentally using APIs newer than the floor, and makes the
# effective target independent of whichever Windows SDK happens to be installed. Applied
# globally here rather than per-target so the installer, services and utilities share it too.
# TODO: remove the X_WARNING defines and fix the code to use non-deprecated APIs.
if(WIN32)
add_compile_definitions(
WINVER=0x0A00
_WIN32_WINNT=0x0A00
NTDDI_VERSION=0x0A000008
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
_CRT_SECURE_NO_WARNINGS
_WINSOCK_DEPRECATED_NO_WARNINGS
)
endif()
# ------------------------------------------------------------------------------
# Build Options (defaults match build_all.py behavior)
# ------------------------------------------------------------------------------
option(BUILD_APP "Build the main GUI application" ON)
option(BUILD_INSTALLER "Build the installer" ON)
option(BUILD_TESTS "Build test executables" OFF)
set(INTEGRATION_TYPE "gui" CACHE STRING "Integration type to build (e.g. gui, cli)")
option(SIGN_APP "Enable app code signing" OFF)
option(SIGN_INSTALLER "Enable installer code signing" OFF)
option(SIGN_BOOTSTRAP "Enable bootstrap code signing" OFF)
option(ENABLE_NOTARIZE "Enable macOS notarization" OFF)
option(CI_MODE "CI-specific behavior" OFF)
option(DEV_MODE "Developer build: disable signature verification and relax security checks" OFF)
if(DEV_MODE AND (CI_MODE OR SIGN_APP OR SIGN_INSTALLER OR SIGN_BOOTSTRAP OR ENABLE_NOTARIZE))
message(FATAL_ERROR "DEV_MODE disables signature verification and must never be combined with CI_MODE, signing, or notarization.")
endif()
option(BUILD_SYMBOLS "Collect PDB symbol files" OFF)
option(STATIC_ANALYSIS "Run clang-tidy static analysis" OFF)
option(UPDATE_TRANSLATIONS "Run lupdate to regenerate .ts translation files" OFF)
# Platform-specific build options (these use WIN32/APPLE which are set before project()
# when using a platform-native generator, e.g. Visual Studio on Windows)
if(WIN32)
option(BUILD_BOOTSTRAP "Build the bootstrap (Windows only)" ON)
option(BUILD_ARM64 "Build for ARM64 architecture" OFF)
# Native ARM64 host tools. Off for an x64 cross-compile (--arm64 on x64 hardware).
option(BUILD_NATIVE_ARM64 "Use native ARM64 host tools (Windows on Arm)" OFF)
elseif(UNIX AND NOT APPLE)
# Linux package type options (default to DEB)
option(BUILD_DEB "Build Debian package" ON)
option(BUILD_RPM "Build RPM package" OFF)
option(BUILD_RPM_OPENSUSE "Build OpenSUSE RPM package" OFF)
endif()
# Default behavior: if no operations specified, enable BUILD_APP, BUILD_INSTALLER, BUILD_BOOTSTRAP
if(NOT BUILD_APP AND NOT BUILD_INSTALLER AND NOT BUILD_BOOTSTRAP AND NOT SIGN_APP AND NOT SIGN_INSTALLER AND NOT SIGN_BOOTSTRAP)
message(STATUS "No build operations specified, defaulting to BUILD_APP, BUILD_INSTALLER, BUILD_BOOTSTRAP")
set(BUILD_APP ON CACHE BOOL "Build the main GUI application" FORCE)
set(BUILD_INSTALLER ON CACHE BOOL "Build the installer" FORCE)
if(WIN32)
set(BUILD_BOOTSTRAP ON CACHE BOOL "Build the bootstrap (Windows only)" FORCE)
endif()
endif()
# Debug/Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
endif()
# Static Analysis Configuration
if(STATIC_ANALYSIS)
set(CMAKE_CXX_CLANG_TIDY
"clang-tidy"
"--checks=clang-analyzer-*,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-diagnostic-deprecated-declarations,-clang-analyzer-osx.cocoa.RetainCount"
"--header-filter=.*/(src|libs)/.*"
"--exclude-header-filter=.*vcpkg/.*"
"--warnings-as-errors=*"
)
endif()
# ------------------------------------------------------------------------------
# Project Configuration
# ------------------------------------------------------------------------------
# vcpkg integration (only needed for build operations, must be before project())
if(BUILD_APP OR BUILD_INSTALLER OR BUILD_BOOTSTRAP)
include(cmake/vcpkg.cmake)
endif()
project(WS LANGUAGES CXX C)
# Install the vcpkg dependencies right after project(), BEFORE the wsnet fetch below. wsnet's
# CMakeLists runs find_package(c-ares/CURL/OpenSSL/...) at configure time, which only resolves once
# these packages exist in ${VCPKG_INSTALLED_DIR}. On a clean CI machine that directory is empty
# until this macro runs; locally it is already populated from prior builds, which is why fetching
# wsnet ahead of the install only fails on CI. The macro depends solely on state established before
# project() (VCPKG_ROOT, VCPKG_TARGET_TRIPLET, CMAKE_BUILD_TYPE, the manifest root), so hoisting it
# here is safe.
if(BUILD_APP OR BUILD_INSTALLER OR BUILD_BOOTSTRAP)
install_vcpkg_dependencies()
endif()
# Fetch wsnet here, in a pristine directory scope, BEFORE any project-wide compile/link options
# exist: the Objective-C ARC option and the Windows hardening flags below, the AUTOMOC/AUTOUIC/
# AUTORCC defaults set per-target, and the WS_* branding defines added after the integration config.
# FetchContent pulls wsnet in via add_subdirectory, which snapshots this scope's options at this
# point, so wsnet builds with only its own settings rather than inheriting ours.
# The include(fetch_wsnet.cmake) calls in src/windscribe-cli, src/client and src/helper then become
# no-ops via their `if(NOT TARGET wsnet::wsnet)` guard, kept as a fallback for building those subdirs
# standalone.
if(BUILD_APP)
include("${CMAKE_SOURCE_DIR}/cmake/fetch_wsnet.cmake")
endif()
# Enable Objective-C ARC for every Objective-C / Objective-C++ source in one place, rather than per
# target. The OBJC/OBJCXX languages must be enabled so .m/.mm are classified as Objective-C(++) and the
# compile-language genex applies -fobjc-arc to them only, never to plain C/C++ sources.
if(APPLE)
enable_language(OBJC)
enable_language(OBJCXX)
set(CMAKE_OBJCXX_STANDARD ${CMAKE_CXX_STANDARD})
set(CMAKE_OBJCXX_STANDARD_REQUIRED ON)
add_compile_options("$<$<COMPILE_LANGUAGE:OBJC,OBJCXX>:-fobjc-arc>")
endif()
# Windows binary hardening: compile- and link-time exploit mitigations for every target in this
# tree (client, CLI, helper service, install/wireguard helpers, installer, uninstaller, bootstrap).
if(WIN32)
add_compile_options(
"$<$<COMPILE_LANGUAGE:C,CXX>:/guard:cf>" # Control Flow Guard
"$<$<COMPILE_LANGUAGE:C,CXX>:/sdl>" # additional security checks (superset of /GS)
"$<$<COMPILE_LANGUAGE:C,CXX>:/Qspectre>" # Spectre v1 mitigation
"$<$<COMPILE_LANGUAGE:C,CXX>:/ZH:SHA_256>" # SHA-256 source hashing in debug info (BinSkim BA2004)
)
add_link_options(
/guard:cf
/DYNAMICBASE # ASLR (linker default; asserted so it cannot regress silently)
/NXCOMPAT # DEP
/HIGHENTROPYVA # 64-bit ASLR
/DEPENDENTLOADFLAG:0x800 # resolve imports/delay-loads from System32 only (anti DLL-planting)
)
if(NOT BUILD_ARM64)
# CET shadow stack compatibility (x64-only flag). /guard:ehcont is deliberately absent:
# unlike /guard:cf, the linker refuses to mix ehcont and non-ehcont objects, so it cannot
# be enabled until the vcpkg static libs (Qt, OpenSSL, ...) are also compiled with it in
# the ws-vcpkg-registry triplets. Without EHCONT metadata CET still protects returns;
# only the opt-in strict-mode exception validation is unavailable.
add_link_options(/CETCOMPAT)
endif()
endif()
include(cmake/architectures.cmake)
# Load integration configuration (after architectures.cmake so that
# WINDSCRIBE_BUILD_LIBS_PATH and PACKAGE_ARCH are available)
set(WS_INTEGRATION_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/cmake/integrations/${INTEGRATION_TYPE}.cmake")
if(NOT EXISTS "${WS_INTEGRATION_CONFIG}")
message(FATAL_ERROR "Integration config not found: ${WS_INTEGRATION_CONFIG}")
endif()
include("${WS_INTEGRATION_CONFIG}")
set(PROJECT_VERSION "${WS_VERSION_MAJOR}.${WS_VERSION_MINOR}.${WS_VERSION_BUILD}" CACHE STRING "" FORCE)
include(cmake/utilities.cmake)
# Derive build suffix from build type (empty for stable releases)
if(WS_BUILD_TYPE STREQUAL "stable")
set(WS_BUILD_SUFFIX "")
else()
set(WS_BUILD_SUFFIX "${WS_BUILD_TYPE}")
endif()
# Sent as ovpn_version on the ServerConfigs request; the server tailors the returned config to it. Only app code consumes this,
# and signing-only configures skip cmake/vcpkg.cmake entirely, leaving VCPKG_ROOT unset. Defined only here so an unguarded use
# fails to compile rather than silently getting "".
if(BUILD_APP)
ws_resolve_port_version(openvpn WS_OPENVPN_VERSION)
# Resolved here rather than next to ws_resolve_shared_libs() below, because the names are needed
# by the branding definitions that follow and by the subdirectories those definitions reach.
if(NOT WIN32)
ws_resolve_openssl_libs()
if(APPLE)
# Not in the branding block below: the value is platform-specific, so a WS_MAC_ name must
# not be defined anywhere it would hold something other than the macOS one.
add_compile_definitions(WS_MAC_HELPER_FRAMEWORK_FILES="${WS_OPENSSL_SSL_LIB} ${WS_OPENSSL_CRYPTO_LIB}")
else()
list(APPEND WS_LINUX_RPATH_BINARIES "lib/${WS_OPENSSL_SSL_LIB}" "lib/${WS_OPENSSL_CRYPTO_LIB}")
endif()
endif()
endif()
# Expose branding to C++ code
add_compile_definitions(
WS_APP_EXECUTABLE_NAME="${WS_APP_EXECUTABLE_NAME}"
WS_CLI_EXECUTABLE_NAME="${WS_CLI_EXECUTABLE_NAME}"
WS_APP_IDENTIFIER="${WS_APP_IDENTIFIER}"
WS_COPYRIGHT="${WS_COPYRIGHT}"
WS_EXTRA_CONFIG_NAME="${WS_EXTRA_CONFIG_NAME}"
WS_LINUX_APP_LOCK_FILE="${WS_LINUX_RUN_DIR}/app.lock"
WS_LINUX_INSTALL_DIR="${WS_LINUX_INSTALL_DIR}"
WS_LINUX_LOG_DIR="${WS_LINUX_LOG_DIR}"
WS_LINUX_RUN_DIR="${WS_LINUX_RUN_DIR}"
WS_LINUX_HELPER_SOCKET="${WS_LINUX_RUN_DIR}/helper.sock"
WS_LINUX_TMP_DIR="${WS_LINUX_TMP_DIR}"
WS_MAC_APP_DIR="${WS_MAC_APP_DIR}"
WS_MAC_APP_LOCK_FILE="${WS_MAC_VENDOR_DIR}/app.lock"
WS_MAC_GID="${WS_MAC_GID}"
WS_MAC_GUI_BUNDLE_ID="${WS_MAC_GUI_BUNDLE_ID}"
WS_MAC_HELPER_BIN_DIR="${WS_MAC_HELPER_BIN_DIR}"
WS_MAC_HELPER_BIN_FILES="${WS_MAC_HELPER_BIN_FILES}"
WS_MAC_HELPER_BUNDLE_ID="${WS_MAC_HELPER_BUNDLE_ID}"
WS_MAC_HELPER_BUNDLE_ID_PATH="Contents/Library/LaunchServices/${WS_MAC_HELPER_BUNDLE_ID}"
WS_MAC_IKEV2_KEYCHAIN_SERVICE="${WS_MAC_IKEV2_KEYCHAIN_SERVICE}"
WS_MAC_INSTALLER_BUNDLE_ID="${WS_MAC_INSTALLER_BUNDLE_ID}"
WS_MAC_INSTALLER_DMG_BUNDLE_ID="${WS_MAC_INSTALLER_DMG_BUNDLE_ID}"
WS_MAC_INSTALLER_BUNDLE_NAME="${WS_MAC_INSTALLER_BUNDLE_NAME}"
WS_MAC_INSTALLER_INNER_BINARY="Contents/MacOS/${WS_MAC_INSTALLER_TARGET}"
WS_MAC_LAUNCHER_BUNDLE_ID="${WS_MAC_LAUNCHER_BUNDLE_ID}"
WS_MAC_SPLIT_TUNNEL_BUNDLE_ID="${WS_MAC_SPLIT_TUNNEL_BUNDLE_ID}"
WS_MAC_UID="${WS_MAC_UID}"
WS_MAC_VENDOR_DIR="${WS_MAC_VENDOR_DIR}"
WS_MAC_VPN_DESCRIPTION="${WS_MAC_VPN_DESCRIPTION}"
WS_POSIX_CONFIG_DIR="${WS_POSIX_CONFIG_DIR}"
WS_OVPN_MGMT_SOCKET="${WS_OVPN_MGMT_SOCKET}"
WS_PRODUCT_NAME="${WS_PRODUCT_NAME}"
WS_PRODUCT_NAME_LOWER="${WS_PRODUCT_NAME_LOWER}"
WS_PRODUCT_NAME_UPPER="${WS_PRODUCT_NAME_UPPER}"
WS_SETTINGS_APP="${WS_SETTINGS_APP}"
WS_SETTINGS_ORG="${WS_SETTINGS_ORG}"
WS_WIN_CONFIG_SUBDIR="${WS_WIN_CONFIG_SUBDIR}"
WS_WIN_IKEV2_CONNECTION_NAME="${WS_WIN_IKEV2_CONNECTION_NAME}"
)
if(DEFINED WS_COMPILE_DEFINITIONS)
add_compile_definitions(${WS_COMPILE_DEFINITIONS})
endif()
if(WS_BUILD_TYPE STREQUAL "guinea_pig")
set(WINDSCRIBE_IS_GUINEA_PIG ON)
elseif(WS_BUILD_TYPE STREQUAL "beta")
set(WINDSCRIBE_IS_BETA ON)
endif()
configure_file(src/client/client-common/version/ws_version.h.in "${CMAKE_BINARY_DIR}/generated/version/ws_version.h" @ONLY)
include_directories("${CMAKE_BINARY_DIR}/generated")
if(DEV_MODE)
add_compile_definitions(WINDSCRIBE_DEV_MODE)
else()
add_compile_definitions(USE_SIGNATURE_CHECK)
endif()
if(NOT CMAKE_SYSTEM_NAME IN_LIST WS_SUPPORTED_PLATFORMS)
message(FATAL_ERROR "Integration '${INTEGRATION_TYPE}' does not support ${CMAKE_SYSTEM_NAME}. Supported: ${WS_SUPPORTED_PLATFORMS}")
endif()
# ------------------------------------------------------------------------------
# Build Configuration Summary
# ------------------------------------------------------------------------------
message(STATUS "")
message(STATUS "==================================================")
message(STATUS "Windscribe Build Configuration Summary")
message(STATUS "==================================================")
message(STATUS "Version: ${PROJECT_VERSION}")
message(STATUS "Build Variant: ${WS_BUILD_TYPE}")
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
if(APPLE)
message(STATUS "Architecture: ${CMAKE_OSX_ARCHITECTURES}")
else()
message(STATUS "Architecture: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
message(STATUS "CI Mode: ${CI_MODE}")
message(STATUS "Dev Mode: ${DEV_MODE}")
message(STATUS "")
message(STATUS "Build Options:")
message(STATUS " Integration: ${INTEGRATION_TYPE}")
if(UNIX AND NOT APPLE)
message(STATUS " Build DEB: ${BUILD_DEB}")
message(STATUS " Build RPM: Fedora ${BUILD_RPM} OpenSUSE ${BUILD_RPM_OPENSUSE}")
endif()
message(STATUS " Build Tests: ${BUILD_TESTS}")
message(STATUS " Static Analysis: ${STATIC_ANALYSIS}")
message(STATUS " Translations: ${UPDATE_TRANSLATIONS}")
if(APPLE)
message(STATUS " Notarization: ${ENABLE_NOTARIZE}")
endif()
message(STATUS "==================================================")
message(STATUS "")
# ------------------------------------------------------------------------------
# Custom Dependencies (Wintun, OpenVPN DCO)
# ------------------------------------------------------------------------------
# Verify WINDSCRIBE_BUILD_LIBS_PATH is set (from architectures.cmake)
if(NOT DEFINED WINDSCRIBE_BUILD_LIBS_PATH)
message(FATAL_ERROR "WINDSCRIBE_BUILD_LIBS_PATH is not defined")
endif()
# Check if custom dependencies directory exists
if(WIN32 AND NOT EXISTS "${WINDSCRIBE_BUILD_LIBS_PATH}")
message(WARNING "Dependencies directory not found: ${WINDSCRIBE_BUILD_LIBS_PATH}")
endif()
# ------------------------------------------------------------------------------
if(WIN32)
set(WS_WSTUNNEL_WIN_EXE "${CMAKE_BINARY_DIR}/wstunnel/${WS_PRODUCT_NAME_LOWER}wstunnel.exe")
if(BUILD_APP AND "wstunnel" IN_LIST WS_BUNDLED_HELPER_NAMES)
ws_add_wstunnel_version_resource("${WS_WSTUNNEL_WIN_EXE}")
endif()
endif()
ws_resolve_bundled_helpers()
ws_resolve_shared_libs()
# ------------------------------------------------------------------------------
# Code Signing Configuration
# ------------------------------------------------------------------------------
include(cmake/signing.cmake)
# ------------------------------------------------------------------------------
# Build Components
# ------------------------------------------------------------------------------
if(BUILD_APP)
if(BUILD_TESTS)
set(IS_BUILD_TESTS ON)
add_compile_definitions(WINDSCRIBE_BUILD_TESTS)
enable_testing()
endif()
# Additional components from integration config
foreach(_subdir ${WS_ADDITIONAL_SUBDIRS})
add_subdirectory(${_subdir})
endforeach()
add_subdirectory(src/helper)
add_subdirectory(src/client)
if(WIN32)
add_custom_target(build-app ALL DEPENDS ${WS_WIN_APP_TARGETS})
elseif(APPLE)
add_custom_target(build-app ALL DEPENDS ${WS_MAC_APP_TARGETS})
elseif(UNIX)
add_custom_target(build-app ALL DEPENDS ${WS_LINUX_APP_TARGETS})
endif()
endif()
# Installers
if(BUILD_INSTALLER)
if(WIN32)
add_subdirectory(src/installer/${INSTALLER_TYPE}/windows/installer)
elseif(APPLE)
add_subdirectory(src/installer/${INSTALLER_TYPE}/macos/installer)
endif()
endif()
if(BUILD_BOOTSTRAP)
if(WIN32)
ws_resolve_output_name("${WS_WIN_OUTPUT_NAME}" _resolved_installer_name)
set(WINDSCRIBE_INSTALLER_NAME "${_resolved_installer_name}.exe" CACHE STRING "Name of internal installer exe")
add_subdirectory(src/installer/${INSTALLER_TYPE}/windows/bootstrap)
endif()
endif()
# ------------------------------------------------------------------------------
# Packaging and Signing
# ------------------------------------------------------------------------------
set(BUILD_EXE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/build-exe")
set(BUILD_TEMP_DIR "${CMAKE_BINARY_DIR}/temp")
set(BUILD_INSTALLER_FILES "${BUILD_TEMP_DIR}/InstallerFiles")
set(BUILD_SYMBOLS_DIR "${BUILD_TEMP_DIR}/SymbolFiles")
set(BUILD_BOOTSTRAP_FILES "${BUILD_TEMP_DIR}/BootstrapFiles")
file(MAKE_DIRECTORY "${BUILD_TEMP_DIR}")
file(MAKE_DIRECTORY "${BUILD_INSTALLER_FILES}")
# Include platform-specific packaging configuration
if(WIN32)
include(cmake/packaging_windows.cmake)
elseif(APPLE)
include(cmake/packaging_macos.cmake)
elseif(UNIX)
include(cmake/packaging_linux.cmake)
endif()