Changeset 218888 in webkit
- Timestamp:
- Jun 28, 2017 1:02:07 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/CMakeLists.txt
r218455 r218888 1 include(CheckCXXSourceCompiles) 2 include(CheckFunctionExists) 3 1 4 set_property(DIRECTORY . PROPERTY FOLDER "WebKit2") 2 5 … … 714 717 endif () 715 718 716 # librt is needed for shm_open on Linux. 717 find_library(LIBRT_LIBRARIES NAMES rt) 718 mark_as_advanced(LIBRT_LIBRARIES) 719 if (LIBRT_LIBRARIES) 720 list(APPEND WebKit2_LIBRARIES ${LIBRT_LIBRARIES}) 719 if (COMPILER_IS_GCC_OR_CLANG) 720 set(ATOMIC_TEST_SOURCE 721 " 722 #include <atomic> 723 int main() { std::atomic<int64_t> i(0); i++; return 0; } 724 " 725 ) 726 check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_IS_BUILTIN) 727 if (NOT ATOMIC_INT64_IS_BUILTIN) 728 set(CMAKE_REQUIRED_LIBRARIES atomic) 729 check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_REQUIRES_LIBATOMIC) 730 if (ATOMIC_INT64_REQUIRES_LIBATOMIC) 731 list(APPEND WebKit2_LIBRARIES atomic) 732 endif () 733 unset(CMAKE_REQUIRED_LIBRARIES) 734 endif () 735 endif () 736 737 if (UNIX) 738 check_function_exists(shm_open SHM_OPEN_EXISTS) 739 if (NOT SHM_OPEN_EXISTS) 740 set(CMAKE_REQUIRED_LIBRARIES rt) 741 check_function_exists(shm_open SHM_OPEN_REQUIRES_LIBRT) 742 if (SHM_OPEN_REQUIRES_LIBRT) 743 list(APPEND WebKit2_LIBRARIES rt) 744 endif () 745 endif () 721 746 endif () 722 747 -
trunk/Source/WebKit2/ChangeLog
r218886 r218888 1 2017-06-28 Konstantin Tokarev <annulen@yandex.ru> 2 3 [cmake] Improve configuration tests for librt and libatomic 4 https://bugs.webkit.org/show_bug.cgi?id=173921 5 6 Reviewed by Michael Catanzaro. 7 8 1. Both tests are converted to use specialized CMake modules 9 2. Both libraries are now linked only if they are really needed and usable 10 by compiler 11 3. librt is no more required to be detected by find_library(), which may fail 12 in case of cross-compilation 13 4. libatomic test moved to port-independent CMakeLists.txt 14 15 * CMakeLists.txt: 16 * PlatformGTK.cmake: 17 1 18 2017-06-28 Alex Christensen <achristensen@webkit.org> 2 19 -
trunk/Source/WebKit2/PlatformGTK.cmake
r218841 r218888 845 845 ) 846 846 847 file(WRITE ${CMAKE_BINARY_DIR}/test_atomic.cpp848 "#include <atomic>\n"849 "int main() { std::atomic<int64_t> i(0); i++; return 0; }\n")850 try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomic.cpp)851 if (NOT ATOMIC_BUILD_SUCCEEDED)852 list(APPEND WebKit2_LIBRARIES atomic)853 endif ()854 file(REMOVE ${CMAKE_BINARY_DIR}/test_atomic.cpp)855 856 847 set(SharedWebKit2Libraries 857 848 ${WebKit2_LIBRARIES}
Note: See TracChangeset
for help on using the changeset viewer.