ladybird/Ports/cmake/patches/0013-platform-serenityos.patch
AnotherTest 80d6f46d4e Ports: Add a cmake port
Yes, you build this *inside* serenity.
2021-02-15 17:32:56 +01:00

30 lines
1.2 KiB
Diff

diff -urp /dev/null a/Modules/Platform/SerenityOS.cmake
--- /dev/null 2021-02-11 00:46:13.390326124 +0330
+++ a/Modules/Platform/SerenityOS.cmake 2021-02-12 16:31:38.421786222 +0330
@@ -0,0 +1,25 @@
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+
+# Shared libraries with no builtin soname may not be linked safely by
+# specifying the file path.
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+
+# Initialize C link type selection flags. These flags are used when
+# building a shared library, shared module, or executable that links
+# to other libraries to select whether to use the static or shared
+# versions of the libraries.
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
+
+# No multi-arch here (yet?)
+unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
+
+include(Platform/UnixPaths)