Build TestWTF on Mac with CMake.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 18:37:02 +0000 (18:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 18:37:02 +0000 (18:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147972

Patch by Alex Christensen <achristensen@webkit.org> on 2015-08-19
Reviewed by Tim Horton.

.:

* Source/cmake/OptionsMac.cmake:
Enable API tests in Mac's CMake build.

Source/WebKit2:

* PlatformMac.cmake:
Make more forwarding headers.

Tools:

TestWTF only depends on gtest and WTF instead of TestWebKitAPi depending on all of WebKit.
Now I can run the WTF API tests after a few seconds of building instead of waiting for all of WebKit to build.

* TestWebKitAPI/CMakeLists.txt:
Added WTF as a dependency for platforms that do not have ForwardingHeadersForTestWebKitAPI_NAME.
WTF was already a library that was linked, but having at least one item makes the syntax of add_dependencies work.
* TestWebKitAPI/PlatformMac.cmake: Added.
* TestWebKitAPI/config.h:
Postpone some build fixes until WebKit builds completely on Mac with CMake.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188643 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformMac.cmake
Source/cmake/OptionsMac.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/CMakeLists.txt
Tools/TestWebKitAPI/PlatformMac.cmake [new file with mode: 0644]
Tools/TestWebKitAPI/config.h

index fd67824..368de1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-08-19  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWTF on Mac with CMake.
+        https://bugs.webkit.org/show_bug.cgi?id=147972
+
+        Reviewed by Tim Horton.
+
+        * Source/cmake/OptionsMac.cmake:
+        Enable API tests in Mac's CMake build.
+
 2015-08-18  Alex Christensen  <achristensen@webkit.org>
 
         [CMake] REGRESSION(r188540): WebKitTestRunner is not longer built and all the tests (layout and perf) fail.
index ab0a989..f74b843 100644 (file)
@@ -1,3 +1,13 @@
+2015-08-19  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWTF on Mac with CMake.
+        https://bugs.webkit.org/show_bug.cgi?id=147972
+
+        Reviewed by Tim Horton.
+
+        * PlatformMac.cmake:
+        Make more forwarding headers.
+
 2015-08-18  Filip Pizlo  <fpizlo@apple.com>
 
         Replace all uses of std::mutex/std::condition_variable with WTF::Lock/WTF::Condition
index cae2ca0..46694d3 100644 (file)
@@ -58,6 +58,7 @@ set(WebKit2_FORWARDING_HEADERS_DIRECTORIES
     UIProcess/Cocoa
 
     UIProcess/API/C
+    UIProcess/API/Cocoa
 
     WebProcess/WebPage
 
index 9e09129..62fe242 100644 (file)
@@ -4,6 +4,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_OVERFLOW_SCROLLING PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_iphoneos PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_iphonesimulator PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_AVF_CAPTIONS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_AVF_CAPTIONS_macosx PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_AVF_CAPTIONS_macosx_1080 PRIVATE OFF)
index 4de7d89..d3579bd 100644 (file)
@@ -1,3 +1,20 @@
+2015-08-19  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWTF on Mac with CMake.
+        https://bugs.webkit.org/show_bug.cgi?id=147972
+
+        Reviewed by Tim Horton.
+
+        TestWTF only depends on gtest and WTF instead of TestWebKitAPi depending on all of WebKit.
+        Now I can run the WTF API tests after a few seconds of building instead of waiting for all of WebKit to build.
+
+        * TestWebKitAPI/CMakeLists.txt:
+        Added WTF as a dependency for platforms that do not have ForwardingHeadersForTestWebKitAPI_NAME.
+        WTF was already a library that was linked, but having at least one item makes the syntax of add_dependencies work.
+        * TestWebKitAPI/PlatformMac.cmake: Added.
+        * TestWebKitAPI/config.h:
+        Postpone some build fixes until WebKit builds completely on Mac with CMake.
+
 2015-08-19  Brian Burg  <bburg@apple.com>
 
         Unreviewed, add Aleksandr Skachkov to the list of contributors.
index be447ab..eb934b2 100644 (file)
@@ -141,7 +141,7 @@ if (ENABLE_WEBKIT2)
     )
 
     target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
-    add_dependencies(TestWebKitAPIInjectedBundle ${ForwardingHeadersForTestWebKitAPI_NAME})
+    add_dependencies(TestWebKitAPIInjectedBundle WTF ${ForwardingHeadersForTestWebKitAPI_NAME})
 
     get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
 endif ()
diff --git a/Tools/TestWebKitAPI/PlatformMac.cmake b/Tools/TestWebKitAPI/PlatformMac.cmake
new file mode 100644 (file)
index 0000000..ad2ae92
--- /dev/null
@@ -0,0 +1,21 @@
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}")
+
+include_directories(
+    ${DERIVED_SOURCES_DIR}/ForwardingHeaders
+    "${WTF_DIR}/icu"
+)
+
+set(test_main_SOURCES
+    ${TESTWEBKITAPI_DIR}/mac/mainMac.mm
+)
+
+find_library(CARBON_LIBRARY Carbon)
+find_library(COCOA_LIBRARY Cocoa)
+find_library(COREFOUNDATION_LIBRARY CoreFoundation)
+list(APPEND test_wtf_LIBRARIES
+    ${CARBON_LIBRARY}
+    ${COCOA_LIBRARY}
+    ${COREFOUNDATION_LIBRARY}
+    libicucore.dylib
+)
index 17c9f4f..2a62583 100644 (file)
 #endif
 
 #if PLATFORM(COCOA) && defined(__OBJC__)
+// FIXME: Get Cocoa tests working with CMake on Mac.
+#if !defined(BUILDING_WITH_CMAKE)
 #import <WebKit/WebKit.h>
 #endif
+#endif
 
 #if !PLATFORM(IOS)
 #define WK_HAVE_C_SPI 1