SHA256
1
0
forked from pool/webkit2gtk3
webkit2gtk3/webkitgtk-libatomic.patch
2015-01-20 17:16:49 +00:00

33 lines
1.1 KiB
Diff

2014-11-20 Alberto Garcia <berto@igalia.com>
Webkit2 doesnt build on powerpc 32 bits
https://bugs.webkit.org/show_bug.cgi?id=130837
Reviewed by NOBODY (OOPS!).
Check if libatomic is needed in order to use std::atomic, and add
it to the list of WebKit2 libraries.
* PlatformGTK.cmake:
diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake
index 954aa0e..298ec7c 100644
--- a/Source/WebKit2/PlatformGTK.cmake
+++ b/Source/WebKit2/PlatformGTK.cmake
@@ -467,6 +467,15 @@ list(APPEND NetworkProcess_SOURCES
NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp
)
+file(WRITE ${CMAKE_BINARY_DIR}/test_atomic.cpp
+ "#include <atomic>\n"
+ "int main() { std::atomic<int64_t> i(0); i++; return 0; }\n")
+try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomic.cpp)
+if (NOT ATOMIC_BUILD_SUCCEEDED)
+ list(APPEND WebKit2_LIBRARIES atomic)
+endif ()
+file(REMOVE ${CMAKE_BINARY_DIR}/test_atomic.cpp)
+
set(SharedWebKit2Libraries
${WebKit2_LIBRARIES}
)