commit c90ca40c80a77277e86563418db6be8a1fd6691f
Author: jens <jens.se@icloud.com>
AuthorDate: Tue Sep 15 12:37:36 2026 +0200
Commit: jens <jens.se@icloud.com>
CommitDate: Tue Sep 15 12:37:36 2026 +0200
Add macOS app icon and build instructions
---
CMakeLists.txt | 19 ++++++++++++++++++-
Hush.icns | Bin 0 -> 1725177 bytes
README.md | 24 ++++++++++++++++++++++++
assets/icon.png | Bin 0 -> 1077858 bytes
4 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7f98cc..5cefd89 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,6 +87,20 @@ endif()
target_compile_options(hush PRIVATE -Wall -Wextra -Wno-unused-parameter)
+if(APPLE)
+ set_source_files_properties(
+ "${CMAKE_SOURCE_DIR}/Hush.icns"
+ PROPERTIES MACOSX_PACKAGE_LOCATION Resources
+ )
+ target_sources(hush PRIVATE "${CMAKE_SOURCE_DIR}/Hush.icns")
+ set_target_properties(hush PROPERTIES
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_BUNDLE_NAME "Hush"
+ MACOSX_BUNDLE_GUI_IDENTIFIER "com.hush.editor"
+ MACOSX_BUNDLE_ICON_FILE "Hush.icns"
+ )
+endif()
+
# `cmake --install build` (or `sudo make install` from build/) puts hush on PATH: the binary
# goes to <prefix>/bin (CMAKE_INSTALL_PREFIX defaults to /usr/local, whose bin/ is already on
# PATH on virtually every Linux distro) and its fonts/language files go to
@@ -94,7 +108,10 @@ target_compile_options(hush PRIVATE -Wall -Wextra -Wno-unused-parameter)
# src/paths.c) -- so the install is fully relocatable and doesn't depend on this source tree
# still being around afterward. Pass -DCMAKE_INSTALL_PREFIX=$HOME/.local to install for just
# your user instead (no sudo needed, as long as ~/.local/bin is already on your PATH).
-install(TARGETS hush RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS hush
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
+)
install(DIRECTORY assets/ DESTINATION ${CMAKE_INSTALL_DATADIR}/hush/assets)
# Headless logic test: no window/GPU context is created, so it can run in CI or over SSH.
diff --git a/Hush.icns b/Hush.icns
new file mode 100644
index 0000000..bd2eb1d
Binary files /dev/null and b/Hush.icns differ
diff --git a/README.md b/README.md
index fe2caa8..4091233 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,30 @@ This produces two binaries in `build/`:
- `hush` — the editor itself
- `hush_test` — a headless test suite for the document/editor logic (no window or GPU context needed, so it can run over SSH or in CI)
+### Building on macOS
+
+Install Xcode Command Line Tools, CMake, and Git. The first build also needs a network connection because SDL2, SDL2_ttf, and SDL2_image are fetched automatically.
+
+On CMake 4, pass the policy compatibility setting required by the vendored FreeType dependency:
+
+```sh
+cmake -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5
+cmake --build build --target hush
+```
+
+This creates a macOS application bundle at `build/hush.app`, including the Hush icon. Open it with:
+
+```sh
+open build/hush.app
+```
+
+Build and run the headless tests with:
+
+```sh
+cmake --build build --target hush_test
+./build/hush_test
+```
+
### Installing (optional)
To put `hush` on your `PATH`:
diff --git a/assets/icon.png b/assets/icon.png
new file mode 100644
index 0000000..bdd8c17
Binary files /dev/null and b/assets/icon.png differ