cmake: Add support for Code Signing on supported platforms

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-11-14 02:57:15 +01:00
parent b436eaaf28
commit e7d17695c5
3 changed files with 20 additions and 2 deletions

3
.gitmodules vendored
View file

@ -1,6 +1,9 @@
[submodule "cmake/clang"]
path = cmake/clang
url = https://github.com/Xaymar/cmake-clang.git
[submodule "cmake/codesign"]
path = cmake/codesign
url = https://github.com/Xaymar/cmake-codesign.git
[submodule "third-party/nlohmann-json"]
path = third-party/nlohmann-json
url = https://github.com/nlohmann/json.git

View file

@ -171,7 +171,6 @@ set(PROJECT_VERSION_STRING ${VERSION_STRING})
# Search Paths
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
@ -326,6 +325,7 @@ set(${PREFIX}ENABLE_UPDATER ON CACHE BOOL "Enable automatic update checks.")
## Code Related
set(${PREFIX}ENABLE_CLANG ON CACHE BOOL "Enable Clang integration for supported compilers.")
set(${PREFIX}ENABLE_CODESIGN OFF CACHE BOOL "Enable Code Signing integration for supported environments.")
set(${PREFIX}ENABLE_PROFILING OFF CACHE BOOL "Enable CPU and GPU performance tracking, which has a non-zero overhead at all times. Do not enable this for release builds.")
# Installation / Packaging
@ -345,10 +345,19 @@ endif()
################################################################################
if(${PREFIX}ENABLE_CLANG AND (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang/Clang.cmake"))
include("Clang")
include("cmake/clang/Clang.cmake")
set(HAVE_CLANG ON)
endif()
################################################################################
# Codesign
################################################################################
if(${PREFIX}ENABLE_CODESIGN AND (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/codesign/CodeSign.cmake"))
include("cmake/codesign/CodeSign.cmake")
set(HAVE_CODESIGN ON)
endif()
################################################################################
# Standalone Build: OBS Studio
################################################################################
@ -1885,6 +1894,11 @@ if(D_PLATFORM_MAC)
endif()
endif()
# Code Sign
if(HAVE_CODESIGN)
codesign(TARGETS ${PROJECT_NAME})
endif()
################################################################################
# Installation
################################################################################

1
cmake/codesign Submodule

@ -0,0 +1 @@
Subproject commit fe22c23c22244e4647e430812b8ceb0322772c81