Skip to content

Commit

Permalink
Making mac bundle identifier configurable at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
gershnik committed May 23, 2023
1 parent d898eab commit 3825f51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ endif()
option(WSDDN_PREFER_SYSTEM "whether to prefer system versions of dependencies (such as libxm2)" ${WSDDN_PREFER_SYSTEM_DEFAULT})

if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")

set(WSDDN_WITH_SYSTEMD "auto" CACHE STRING "enable systemd scripts and notification support")
endif()

if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(WSDDN_BUNDLE_IDENTIFIER "io.github.gershnik.wsddn" CACHE STRING "macOS bundle identifier")
endif()


Expand Down
2 changes: 1 addition & 1 deletion src/Info.template.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>io.github.gershnik.wsdd-native</string>
<string>@WSDDN_BUNDLE_IDENTIFIER@</string>
<key>CFBundleName</key>
<string>wsddn</string>
<key>CFBundleDisplayName</key>
Expand Down
1 change: 1 addition & 0 deletions src/sys_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define ADMIN_GROUP_NAME "admin"
#define WSDDN_DEFAULT_USER_NAME "_wsddn"
#define WSDDN_DEFAULT_CHROOT_DIR "/var/empty"
#define WSDDN_BUNDLE_IDENTIFIER "@WSDDN_BUNDLE_IDENTIFIER@"
#else
#define WSDDN_PLATFORM_APPLE 0
#define WSDDN_DEFAULT_USER_NAME "wsddn"
Expand Down
2 changes: 1 addition & 1 deletion src/sys_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class SystemdLevelFormatter : public spdlog::custom_flag_formatter
{
using super = spdlog::sinks::base_sink<Mutex>;
public:
OsLogSink() noexcept : m_logger(os_log_create("io.github.gershnik.wsddn", "default")) {
OsLogSink() noexcept : m_logger(os_log_create(WSDDN_BUNDLE_IDENTIFIER, "default")) {
}
~OsLogSink() noexcept {
os_release(m_logger);
Expand Down

0 comments on commit 3825f51

Please sign in to comment.