[CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64...
authorberto@igalia.com <berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2018 13:33:50 +0000 (13:33 +0000)
committerberto@igalia.com <berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2018 13:33:50 +0000 (13:33 +0000)
commit89f041cb91c85713f1e39b79ef618769c51ea78a
tree7a9ccab9692b1f29c319aa5b84e60464cdebc7f5
parent60dd675194948d8ec9755c5d53aa64061fd40274
[CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
https://bugs.webkit.org/show_bug.cgi?id=182622

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsWPE.cmake:
Enable THREADS_PREFER_PTHREAD_FLAG. This uses -pthread instead of
-lpthread, fixing the 64-bit RISC-V build of the GTK+ port due to
missing atomic primitives.

* Source/cmake/WebKitCompilerFlags.cmake:
Move the test to detect whether we need to link against libatomic
to a common CMake file so it can be used from both JavaScriptCore
and WebKit.

Source/JavaScriptCore:

We were linking JavaScriptCore against libatomic in MIPS because
in that architecture __atomic_fetch_add_8() is not a compiler
intrinsic and is provided by that library instead. However other
architectures (e.g armel) are in the same situation, so we need a
generic test.

That test already exists in WebKit/CMakeLists.txt, so we just have
to move it to a common file (WebKitCompilerFlags.cmake) and use
its result (ATOMIC_INT64_REQUIRES_LIBATOMIC) here.

* CMakeLists.txt:

Source/WebKit:

Move the test to determine whether we need to link against
libatomic to the common file WebKitCompilerFlags.cmake so it can
also be used for JavaScriptCore.

* CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsJSCOnly.cmake
Source/cmake/OptionsWPE.cmake
Source/cmake/WebKitCompilerFlags.cmake