summaryrefslogtreecommitdiff
path: root/xM/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-08-30 00:35:34 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-09-01 01:12:51 +0200
commit1c4343058da2a1e0c6d2fd87a9bde4ef4b378eae (patch)
treef21e929cf633af5eb7e0ada712a9ee6d63be2bb4 /xM/CMakeLists.txt
parente5156cddbf93f7c55868f5fb80a021b950f4a2c7 (diff)
downloadxK-1c4343058da2a1e0c6d2fd87a9bde4ef4b378eae.tar.gz
xK-1c4343058da2a1e0c6d2fd87a9bde4ef4b378eae.tar.xz
xK-1c4343058da2a1e0c6d2fd87a9bde4ef4b378eae.zip
Add a Cocoa frontend for xC
Some work remains to be done to get it to be even as good as the Win32 frontend, but it's generally usable.
Diffstat (limited to 'xM/CMakeLists.txt')
-rw-r--r--xM/CMakeLists.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/xM/CMakeLists.txt b/xM/CMakeLists.txt
new file mode 100644
index 0000000..3386926
--- /dev/null
+++ b/xM/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Swift language support
+cmake_minimum_required (VERSION 3.15)
+
+file (READ ../xK-version project_version)
+configure_file (../xK-version xK-version.tag COPYONLY)
+string (STRIP "${project_version}" project_version)
+
+# There were two issues when building this from the main CMakeLists.txt:
+# a) renaming main.swift to xM.swift requires removing top-level statements,
+# b) there is a "redefinition of module 'FFI'" error.
+project (xM VERSION "${project_version}"
+ DESCRIPTION "Cocoa frontend for xC" LANGUAGES Swift)
+
+set (root "${PROJECT_SOURCE_DIR}/..")
+add_custom_command (OUTPUT xC-proto.swift
+ COMMAND env LC_ALL=C awk
+ -f ${root}/liberty/tools/lxdrgen.awk
+ -f ${root}/liberty/tools/lxdrgen-swift.awk
+ -v PrefixCamel=Relay
+ ${root}/xC.lxdr > xC-proto.swift
+ DEPENDS
+ ${root}/liberty/tools/lxdrgen.awk
+ ${root}/liberty/tools/lxdrgen-swift.awk
+ ${root}/xC.lxdr
+ COMMENT "Generating xC relay protocol code" VERBATIM)
+
+set (MACOSX_BUNDLE_GUI_IDENTIFIER name.janouch.${PROJECT_NAME})
+
+# Other requirements: macOS 10.14 for Network, and macOS 11 for Logger.
+set (CMAKE_Swift_LANGUAGE_VERSION 5)
+add_executable (xM MACOSX_BUNDLE
+ main.swift ${PROJECT_BINARY_DIR}/xC-proto.swift)