From a6e5c9ec1ba3d67f64aa31aff9e8d0a697678a9c Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Wed, 28 Apr 2021 10:20:51 -0400 Subject: [PATCH] macOS requires embedding plist files in order to enable modern security features such as enabling the hardened runtime and notarizing executables and disk images containing them. This change provides a plist file to be embedded, and modifies the linker flags for macOS targets in order to include the plist in the binary. This is done to the Mach O executable in a backwards-compatible way, and has been tested as far back as macOS 10.12 High Sierra. Note: expect to carry this forward to 'next' branch; however this is being applied to current official release master version 5.6.0 so that release disk images can be notarized. --- CMakeLists.txt | 3 +++ console/Info.plist | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 console/Info.plist diff --git a/CMakeLists.txt b/CMakeLists.txt index 631f0fd..a825e2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -439,6 +439,9 @@ if (SUPPORT_CONSOLE_APP) if (MSVC) set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d ) endif () + if (APPLE) + target_link_options(${name} PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/console/Info.plist) + endif () if (NOT TIDY_CONSOLE_SHARED) set_target_properties( ${name} PROPERTIES COMPILE_FLAGS "-DTIDY_STATIC" ) diff --git a/console/Info.plist b/console/Info.plist new file mode 100644 index 0000000..3f0b65b --- /dev/null +++ b/console/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleIdentifier + org.htacg.html-tidy.tidy5 + CFBundleInfoDictionaryVersion + 6.0 + CFBundleShortVersionString + 5.6.0 + CFBundleVersion + 5.6.0 + +