Title: [122943] trunk
Revision
122943
Author
[email protected]
Date
2012-07-18 04:15:41 -0700 (Wed, 18 Jul 2012)

Log Message

[CMake] Make gtest a shared library
https://bugs.webkit.org/show_bug.cgi?id=90973

Patch by Thiago Marcos P. Santos <[email protected]> on 2012-07-18
Reviewed by Daniel Bates.

.:

It's nicer to make it a shared library because it might improve
linking time and we don't need to force gtest users to link with gtest
dependencies like pthreads (which causes linking errors when it is not
available).

* Source/cmake/gtest/CMakeLists.txt:

Source/WebKit:

No need to link with gtest dependencies now since it is a shared library.

* PlatformEfl.cmake:

Source/WebKit2:

No need to link with gtest dependencies now since it is a shared library.

* PlatformEfl.cmake:

Modified Paths

Diff

Modified: trunk/ChangeLog (122942 => 122943)


--- trunk/ChangeLog	2012-07-18 10:54:21 UTC (rev 122942)
+++ trunk/ChangeLog	2012-07-18 11:15:41 UTC (rev 122943)
@@ -1,3 +1,17 @@
+2012-07-18  Thiago Marcos P. Santos  <[email protected]>
+
+        [CMake] Make gtest a shared library
+        https://bugs.webkit.org/show_bug.cgi?id=90973
+
+        Reviewed by Daniel Bates.
+
+        It's nicer to make it a shared library because it might improve
+        linking time and we don't need to force gtest users to link with gtest
+        dependencies like pthreads (which causes linking errors when it is not
+        available).
+
+        * Source/cmake/gtest/CMakeLists.txt:
+
 2012-07-17  Gabor Ballabas  <[email protected]>
 
         [Qt][V8] Remove the V8 related codepaths and configuration

Modified: trunk/Source/WebKit/ChangeLog (122942 => 122943)


--- trunk/Source/WebKit/ChangeLog	2012-07-18 10:54:21 UTC (rev 122942)
+++ trunk/Source/WebKit/ChangeLog	2012-07-18 11:15:41 UTC (rev 122943)
@@ -1,3 +1,14 @@
+2012-07-18  Thiago Marcos P. Santos  <[email protected]>
+
+        [CMake] Make gtest a shared library
+        https://bugs.webkit.org/show_bug.cgi?id=90973
+
+        Reviewed by Daniel Bates.
+
+        No need to link with gtest dependencies now since it is a shared library.
+
+        * PlatformEfl.cmake:
+
 2012-07-17  Ryuan Choi  <[email protected]>
 
         [EFL] Move codes related to theme setting from Widget to RenderTheme

Modified: trunk/Source/WebKit/PlatformEfl.cmake (122942 => 122943)


--- trunk/Source/WebKit/PlatformEfl.cmake	2012-07-18 10:54:21 UTC (rev 122942)
+++ trunk/Source/WebKit/PlatformEfl.cmake	2012-07-18 11:15:41 UTC (rev 122943)
@@ -297,6 +297,7 @@
 INCLUDE_DIRECTORIES(${THIRDPARTY_DIR}/gtest/include)
 
 SET(EWKUnitTests_LIBRARIES
+    ${WTF_LIBRARY_NAME}
     ${_javascript_Core_LIBRARY_NAME}
     ${WebCore_LIBRARY_NAME}
     ${WebKit_LIBRARY_NAME}
@@ -304,6 +305,7 @@
     ${ECORE_EVAS_LIBRARIES}
     ${EVAS_LIBRARIES}
     ${EDJE_LIBRARIES}
+    gtest
 )
 
 SET(EWKUnitTests_INCLUDE_DIRECTORIES
@@ -335,8 +337,10 @@
 
 SET(DEFAULT_TEST_PAGE_DIR ${CMAKE_SOURCE_DIR}/Source/WebKit/efl/tests/resources)
 
-ADD_DEFINITIONS(-DDEFAULT_TEST_PAGE_DIR=\"${DEFAULT_TEST_PAGE_DIR}\")
-ADD_DEFINITIONS(-DDEFAULT_THEME_PATH=\"${THEME_BINARY_DIR}\")
+ADD_DEFINITIONS(-DDEFAULT_TEST_PAGE_DIR=\"${DEFAULT_TEST_PAGE_DIR}\"
+    -DDEFAULT_THEME_PATH=\"${THEME_BINARY_DIR}\"
+    -DGTEST_LINKED_AS_SHARED_LIBRARY=1
+)
 
 ADD_LIBRARY(ewkTestUtils
     ${WEBKIT_DIR}/efl/tests/UnitTestUtils/EWKTestBase.cpp
@@ -354,7 +358,7 @@
     FOREACH (testName ${EWKUnitTests_BINARIES})
         ADD_EXECUTABLE(${testName} ${WEBKIT_EFL_TEST_DIR}/${testName}.cpp ${WEBKIT_EFL_TEST_DIR}/test_runner.cpp)
         ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName})
-        TARGET_LINK_LIBRARIES(${testName} ${EWKUnitTests_LIBRARIES} ewkTestUtils gtest pthread)
+        TARGET_LINK_LIBRARIES(${testName} ${EWKUnitTests_LIBRARIES} ewkTestUtils)
         ADD_TARGET_PROPERTIES(${testName} LINK_FLAGS "${EWKUnitTests_LINK_FLAGS}")
         SET_TARGET_PROPERTIES(${testName} PROPERTIES FOLDER "WebKit")
     ENDFOREACH ()

Modified: trunk/Source/WebKit2/ChangeLog (122942 => 122943)


--- trunk/Source/WebKit2/ChangeLog	2012-07-18 10:54:21 UTC (rev 122942)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-18 11:15:41 UTC (rev 122943)
@@ -1,3 +1,14 @@
+2012-07-18  Thiago Marcos P. Santos  <[email protected]>
+
+        [CMake] Make gtest a shared library
+        https://bugs.webkit.org/show_bug.cgi?id=90973
+
+        Reviewed by Daniel Bates.
+
+        No need to link with gtest dependencies now since it is a shared library.
+
+        * PlatformEfl.cmake:
+
 2012-07-18  YoungTaeck Song  <[email protected]>
 
         [WK2][EFL] Add a common code using Color instead of QColor

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (122942 => 122943)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2012-07-18 10:54:21 UTC (rev 122942)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2012-07-18 11:15:41 UTC (rev 122943)
@@ -188,12 +188,14 @@
 INCLUDE_DIRECTORIES(${THIRDPARTY_DIR}/gtest/include)
 
 SET(EWK2UnitTests_LIBRARIES
+    ${WTF_LIBRARY_NAME}
     ${_javascript_Core_LIBRARY_NAME}
     ${WebCore_LIBRARY_NAME}
     ${WebKit2_LIBRARY_NAME}
     ${ECORE_LIBRARIES}
     ${ECORE_EVAS_LIBRARIES}
     ${EVAS_LIBRARIES}
+    gtest
 )
 
 IF (ENABLE_GLIB_SUPPORT)
@@ -206,7 +208,9 @@
 SET(WEBKIT2_EFL_TEST_DIR "${WEBKIT2_DIR}/UIProcess/API/efl/tests")
 SET(TEST_RESOURCES_DIR ${WEBKIT2_EFL_TEST_DIR}/resources)
 
-ADD_DEFINITIONS(-DTEST_RESOURCES_DIR=\"${TEST_RESOURCES_DIR}\")
+ADD_DEFINITIONS(-DTEST_RESOURCES_DIR=\"${TEST_RESOURCES_DIR}\"
+    -DGTEST_LINKED_AS_SHARED_LIBRARY=1
+)
 
 ADD_LIBRARY(ewk2UnitTestUtils
     ${WEBKIT2_EFL_TEST_DIR}/UnitTestUtils/EWK2UnitTestBase.cpp
@@ -227,6 +231,6 @@
         ADD_EXECUTABLE(${testName} ${WEBKIT2_EFL_TEST_DIR}/${testName}.cpp)
         ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName})
         SET_TESTS_PROPERTIES(${testName} PROPERTIES TIMEOUT 60)
-        TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils gtest pthread)
+        TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils)
     ENDFOREACH ()
 ENDIF ()

Modified: trunk/Source/cmake/gtest/CMakeLists.txt (122942 => 122943)


--- trunk/Source/cmake/gtest/CMakeLists.txt	2012-07-18 10:54:21 UTC (rev 122942)
+++ trunk/Source/cmake/gtest/CMakeLists.txt	2012-07-18 11:15:41 UTC (rev 122943)
@@ -11,7 +11,7 @@
 
 SET(GTEST_DIR "${THIRDPARTY_DIR}/gtest")
 
-ADD_LIBRARY(gtest
+ADD_LIBRARY(gtest SHARED
     ${GTEST_DIR}/src/gtest.cc
     ${GTEST_DIR}/src/gtest-death-test.cc
     ${GTEST_DIR}/src/gtest-filepath.cc
@@ -20,3 +20,14 @@
     ${GTEST_DIR}/src/gtest-test-part.cc
     ${GTEST_DIR}/src/gtest-typed-test.cc
 )
+
+ADD_DEFINITIONS(-DGTEST_CREATE_SHARED_LIBRARY=1)
+
+TARGET_LINK_LIBRARIES(gtest
+    ${WTF_LIBRARY_NAME}
+)
+
+IF(CMAKE_USE_PTHREADS_INIT)
+    TARGET_LINK_LIBRARIES(gtest ${CMAKE_THREAD_LIBS_INIT})
+    ADD_DEFINITIONS(-DGTEST_HAS_PTHREAD=1)
+ENDIF()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to