Link with libatomic on some arches.
authorHilmar Preusse <hille42@web.de>
Sat, 15 Jun 2024 21:25:01 +0000 (23:25 +0200)
committerHilmar Preusse <hille42@web.de>
Sat, 15 Jun 2024 21:25:01 +0000 (23:25 +0200)
Last-Update: 2024-02-21
Forwarded: not needed.

Gbp-Pq: Name link_atomic.diff

cmake/luametatex.cmake

index 7d772ae415e81f6ca8c4cd677f2d4a538481dbc9..8b42b94e7e8a881ee17daddb9efd222c88f590a1 100644 (file)
@@ -1,3 +1,13 @@
+# Debian: determine host arch.
+execute_process(COMMAND
+  dpkg-architecture
+    -qDEB_HOST_ARCH
+  OUTPUT_VARIABLE
+    CMAKE_DEB_HOST_ARCH
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+
 add_compile_options(-DLUA_CORE)
 
 set(luametatex_sources
@@ -69,6 +79,13 @@ if (NOT MSVC)
 )
 endif()
 
+# Debian: link with atomic on specific arches.
+if(${CMAKE_DEB_HOST_ARCH} MATCHES "m68k" OR ${CMAKE_DEB_HOST_ARCH} MATCHES "powerpc" OR ${CMAKE_DEB_HOST_ARCH} MATCHES "sh4" OR ${CMAKE_DEB_HOST_ARCH} MATCHES "armel")
+    target_link_libraries(luametatex
+        atomic
+)
+endif()
+
 if (${CMAKE_HOST_SOLARIS})
     target_link_libraries(luametatex
         rt