mirror of https://github.com/oxen-io/lokinet
Require explicit disabling of codesigning
Make the mac build require passing either an explicit -DCODESIGN=OFF or the code signing identities.
This commit is contained in:
parent
5dd71995c4
commit
49b2878209
|
@ -260,6 +260,7 @@ local mac_builder(name,
|
||||||
cmake_extra='',
|
cmake_extra='',
|
||||||
extra_cmds=[],
|
extra_cmds=[],
|
||||||
jobs=6,
|
jobs=6,
|
||||||
|
codesign='-DCODESIGN=OFF',
|
||||||
allow_fail=false) = {
|
allow_fail=false) = {
|
||||||
kind: 'pipeline',
|
kind: 'pipeline',
|
||||||
type: 'exec',
|
type: 'exec',
|
||||||
|
@ -276,7 +277,7 @@ local mac_builder(name,
|
||||||
// basic system headers. WTF apple:
|
// basic system headers. WTF apple:
|
||||||
'export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"',
|
'export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"',
|
||||||
'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk
|
'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk
|
||||||
'./contrib/mac.sh ' + ci_mirror_opts,
|
'./contrib/mac.sh ' + ci_mirror_opts + ' ' + codesign,
|
||||||
] + extra_cmds,
|
] + extra_cmds,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -70,7 +70,8 @@ endforeach()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
|
||||||
set(CODESIGN_APP "" CACHE STRING "codesign the macos app using this key identity")
|
set(CODESIGN_APP "" CACHE STRING "codesign the macos app using this key identity")
|
||||||
set(CODESIGN_APPEX "${CODESIGN_APP}" CACHE STRING "codesign the internal extension using this key identity; defaults to CODESIGN_APP if empty")
|
set(CODESIGN_EXT "${CODESIGN_APP}" CACHE STRING "codesign the internal extension using this key identity; defaults to CODESIGN_APP if empty")
|
||||||
|
option(CODESIGN "codesign the resulting app and extension" ON)
|
||||||
|
|
||||||
set(mac_icon ${CMAKE_CURRENT_BINARY_DIR}/lokinet.icns)
|
set(mac_icon ${CMAKE_CURRENT_BINARY_DIR}/lokinet.icns)
|
||||||
add_custom_command(OUTPUT ${mac_icon}
|
add_custom_command(OUTPUT ${mac_icon}
|
||||||
|
@ -100,8 +101,14 @@ if(APPLE)
|
||||||
MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/contrib/macos/Info.plist.in"
|
MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/contrib/macos/Info.plist.in"
|
||||||
MACOSX_BUNDLE_ICON_FILE "${mac_icon}"
|
MACOSX_BUNDLE_ICON_FILE "${mac_icon}"
|
||||||
MACOSX_BUNDLE_COPYRIGHT "© 2021, The Oxen Project")
|
MACOSX_BUNDLE_COPYRIGHT "© 2021, The Oxen Project")
|
||||||
if (CODESIGN_APP AND CODESIGN_APPEX)
|
if(NOT CODESIGN)
|
||||||
message(STATUS "codesigning with ${CODESIGN_APP} (app) ${CODESIGN_APPEX} (appex)")
|
message(STATUS "codesigning disabled")
|
||||||
|
add_custom_target(
|
||||||
|
sign
|
||||||
|
DEPENDS lokinet lokinet-extension
|
||||||
|
COMMAND "true")
|
||||||
|
elseif (CODESIGN_APP AND CODESIGN_EXT)
|
||||||
|
message(STATUS "codesigning with ${CODESIGN_APP} (app) ${CODESIGN_EXT} (appex)")
|
||||||
set(SIGN_TARGET "${CMAKE_CURRENT_BINARY_DIR}/lokinet.app")
|
set(SIGN_TARGET "${CMAKE_CURRENT_BINARY_DIR}/lokinet.app")
|
||||||
configure_file(
|
configure_file(
|
||||||
"${PROJECT_SOURCE_DIR}/contrib/macos/sign.sh.in"
|
"${PROJECT_SOURCE_DIR}/contrib/macos/sign.sh.in"
|
||||||
|
@ -113,11 +120,7 @@ if(APPLE)
|
||||||
COMMAND "${PROJECT_BINARY_DIR}/sign.sh"
|
COMMAND "${PROJECT_BINARY_DIR}/sign.sh"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(WARNING "Not codesigning: CODESIGN_APP (=${CODESIGN_APP}) and/or CODESIGN_APPEX (=${CODESIGN_APPEX}) are not set")
|
message(FATAL_ERROR "CODESIGN_APP (=${CODESIGN_APP}) and/or CODESIGN_EXT (=${CODESIGN_EXT}) are not set. To disable code signing use -DCODESIGN=OFF")
|
||||||
add_custom_target(
|
|
||||||
sign
|
|
||||||
DEPENDS lokinet lokinet-extension
|
|
||||||
COMMAND "true")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue