summaryrefslogtreecommitdiff
path: root/cmake/MAX25Platform.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/MAX25Platform.cmake')
-rw-r--r--cmake/MAX25Platform.cmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/cmake/MAX25Platform.cmake b/cmake/MAX25Platform.cmake
new file mode 100644
index 0000000..c121551
--- /dev/null
+++ b/cmake/MAX25Platform.cmake
@@ -0,0 +1,37 @@
+# MAX25-Stack-Lite platform defaults.
+#
+# Lite ship policy (settled): BayCom/based (stacks/max25-bcpr) is in-scope and
+# default ON on every POSIX-like Lite target — see product-repo-rules.md
+# "CMake ship profile (Lite)" and design-principles.md. This module must not
+# reintroduce the upstream MAX25-Stack default (bcpr opt-in/OFF) here, because
+# CMake's option() in the top-level CMakeLists.txt cannot override a CACHE
+# variable already created by an earlier include() — this module runs first.
+
+set(MAX25_SYSTEM "${CMAKE_SYSTEM_NAME}")
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ set(MAX25_PLATFORM "linux")
+ set(MAX25_DEFAULT_BUILD_TNCS ON)
+ set(MAX25_DEFAULT_BUILD_MAX25_BCPR ON)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+ set(MAX25_PLATFORM "freebsd")
+ set(MAX25_DEFAULT_BUILD_TNCS OFF)
+ set(MAX25_DEFAULT_BUILD_MAX25_BCPR ON)
+elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD|NetBSD|DragonFly")
+ set(MAX25_PLATFORM "bsd")
+ set(MAX25_DEFAULT_BUILD_TNCS OFF)
+ set(MAX25_DEFAULT_BUILD_MAX25_BCPR ON)
+else()
+ set(MAX25_PLATFORM "generic")
+ set(MAX25_DEFAULT_BUILD_TNCS OFF)
+ set(MAX25_DEFAULT_BUILD_MAX25_BCPR OFF)
+endif()
+
+if(NOT DEFINED MAX25_BUILD_TNCS)
+ set(MAX25_BUILD_TNCS ${MAX25_DEFAULT_BUILD_TNCS} CACHE BOOL "Build stacks/tncs tools (not shipped in Lite; no-op)")
+endif()
+if(NOT DEFINED MAX25_BUILD_MAX25_BCPR)
+ set(MAX25_BUILD_MAX25_BCPR ${MAX25_DEFAULT_BUILD_MAX25_BCPR} CACHE BOOL "Build stacks/max25-bcpr BayCom/based SER12 (Lite: in-scope, default ON)")
+endif()
+
+message(STATUS "MAX25 platform=${MAX25_PLATFORM} system=${MAX25_SYSTEM}")
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com