[CMake] Undefined references should be detected at build time
authorkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jul 2013 08:37:03 +0000 (08:37 +0000)
committerkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jul 2013 08:37:03 +0000 (08:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110236

Patch by Balazs Kelemen <kbalazs@webkit.org> on 2013-07-16
Reviewed by Christophe Dumez.

.:

Pass the --no-undefined argument to the linker on platforms where it is available.

* Source/cmake/OptionsCommon.cmake:

Source/WebKit:

Add library dependencies that were not defined explicitly before.

* CMakeLists.txt:
* PlatformEfl.cmake:

Source/WebKit2:

Add library dependencies that were not defined explicitly before.

* CMakeLists.txt:
* PlatformEfl.cmake:

Tools:

Add library dependencies that were not defined explicitly before.

* DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
* TestWebKitAPI/CMakeLists.txt:
* WebKitTestRunner/CMakeLists.txt:

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

13 files changed:
ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/cmake/OptionsCommon.cmake
Tools/ChangeLog
Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
Tools/TestWebKitAPI/CMakeLists.txt
Tools/WebKitTestRunner/CMakeLists.txt

index 146f919..bed571c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-07-16  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [CMake] Undefined references should be detected at build time
+        https://bugs.webkit.org/show_bug.cgi?id=110236
+
+        Reviewed by Christophe Dumez.
+
+        Pass the --no-undefined argument to the linker on platforms where it is available.
+
+        * Source/cmake/OptionsCommon.cmake:
+
 2013-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Remove compile warnings about GTK+ API deprecated after 3.6
index 0bc0b79..488cfb4 100644 (file)
@@ -2959,6 +2959,12 @@ set(WebCoreTestSupport_SOURCES
     platform/mock/PlatformSpeechSynthesizerMock.cpp
 )
 
+set(WebCoreTestSupport_LIBRARIES
+    JavaScriptCore
+    WTF
+    WebCore
+)
+
 # Modules that the bindings generator scripts may use
 set(SCRIPTS_RESOLVE_SUPPLEMENTAL
     ${WEBCORE_DIR}/bindings/scripts/IDLParser.pm
@@ -3211,15 +3217,13 @@ if (WebCore_OUTPUT_NAME)
 endif ()
 
 add_library(WebCoreTestSupport ${WebCoreTestSupport_LIBRARY_TYPE} ${WebCoreTestSupport_SOURCES})
+target_link_libraries(WebCoreTestSupport ${WebCoreTestSupport_LIBRARIES})
 set_target_properties(WebCoreTestSupport PROPERTIES FOLDER "WebCore")
 
 if (WebCoreTestSupport_OUTPUT_NAME)
     set_target_properties(WebCoreTestSupport PROPERTIES OUTPUT_NAME ${WebCoreTestSupport_OUTPUT_NAME})
 endif ()
 
-add_dependencies(WebCore JavaScriptCore)
-add_dependencies(WebCoreTestSupport WebCore)
-
 if (WTF_USE_LEVELDB)
     add_library(leveldb STATIC ${LEVELDB_SOURCES})
     target_link_libraries(leveldb ${CMAKE_THREAD_LIBS_INIT})
index 2fb889d..838d4f0 100644 (file)
@@ -78,6 +78,8 @@ if (WTF_USE_CURL)
 endif ()
 
 set(WebKit_LIBRARIES
+    JavaScriptCore
+    WTF
     WebCore
 )
 
index 3c8f917..19fb410 100644 (file)
@@ -1,3 +1,15 @@
+2013-07-16  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [CMake] Undefined references should be detected at build time
+        https://bugs.webkit.org/show_bug.cgi?id=110236
+
+        Reviewed by Christophe Dumez.
+
+        Add library dependencies that were not defined explicitly before.
+
+        * CMakeLists.txt:
+        * PlatformEfl.cmake:
+
 2013-07-11  Timothy Hatcher  <timothy@apple.com>
 
         Revert r152267 and soft link WebInspectorUI.framework again.
index 019b5dc..9fdad60 100644 (file)
@@ -154,6 +154,8 @@ list(APPEND WebKit_SOURCES
 list(APPEND WebKit_LIBRARIES
     ${CAIRO_LIBRARIES}
     ${ECORE_LIBRARIES}
+    ${EDJE_LIBRARIES}
+    ${EINA_LIBRARIES}
     ${ECORE_EVAS_LIBRARIES}
     ${ECORE_INPUT_LIBRARIES}
     ${EFREET_LIBRARIES}
@@ -172,6 +174,12 @@ list(APPEND WebKit_LIBRARIES
     ${LIBSOUP_LIBRARIES}
 )
 
+if (ENABLE_ECORE_X)
+    list(APPEND WebKit_LIBRARIES
+        ${ECORE_X_LIBRARIES}
+    )
+endif ()
+
 if (SHARED_CORE)
     set(LIBS_PRIVATE "-l${WTF_OUTPUT_NAME} -l${JavaScriptCore_OUTPUT_NAME} -l${WebCore_OUTPUT_NAME}")
 else ()
index a5e2b03..c2144c0 100644 (file)
@@ -603,10 +603,17 @@ set(WebProcess_LIBRARIES
 )
 
 set(WebKit2_LIBRARIES
+    JavaScriptCore
     WTF
     WebCore
 )
 
+# librt is needed for shm_open on Linux.
+find_library(LIBRT_LIBRARIES NAMES rt)
+if (LIBRT_LIBRARIES)
+    list(APPEND WebKit2_LIBRARIES ${LIBRT_LIBRARIES})
+endif ()
+
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 # Create JavaScript C++ code given an IDL input
index 1ba2f7f..023e5d7 100644 (file)
@@ -1,3 +1,15 @@
+2013-07-16  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [CMake] Undefined references should be detected at build time
+        https://bugs.webkit.org/show_bug.cgi?id=110236
+
+        Reviewed by Christophe Dumez.
+
+        Add library dependencies that were not defined explicitly before.
+
+        * CMakeLists.txt:
+        * PlatformEfl.cmake:
+
 2013-07-17  Dong-Gwan Kim  <donggwan.kim@samsung.com>
 
         [EFL][WK2] EWK2WindowFeaturesTest should be defined by inheriting from EWK2UnitTestBase.
index 88f9cfb..dbb766b 100644 (file)
@@ -228,6 +228,7 @@ list(APPEND WebKit2_LIBRARIES
     ${CAIRO_LIBRARIES}
     ${ECORE_LIBRARIES}
     ${ECORE_EVAS_LIBRARIES}
+    ${ECORE_IMF_EVAS_LIBRARIES}
     ${EDJE_LIBRARIES}
     ${EFREET_LIBRARIES}
     ${EINA_LIBRARIES}
@@ -283,7 +284,11 @@ endif ()
 if (ENABLE_ECORE_X)
     list(APPEND WebProcess_LIBRARIES
         ${ECORE_X_LIBRARIES}
-        ${X11_Xext_LIB})
+        ${X11_Xext_LIB}
+    )
+    list(APPEND WebKit2_LIBRARIES
+        ${ECORE_X_LIBRARIES}
+    )
 endif ()
 
 add_custom_target(forwarding-headerEfl
@@ -357,6 +362,12 @@ if (ENABLE_PLUGIN_PROCESS)
         WebKit2
     )
 
+    if (ENABLE_ECORE_X)
+        list(APPEND PluginProcess_LIBRARIES
+            ${ECORE_X_LIBRARIES}
+        )
+    endif ()
+
     add_executable(PluginProcess ${PluginProcess_SOURCES})
     target_link_libraries(PluginProcess ${PluginProcess_LIBRARIES})
     install(TARGETS PluginProcess DESTINATION "${EXEC_INSTALL_DIR}")
index 0acbcfc..ee3ce7a 100644 (file)
@@ -31,6 +31,10 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${LOWERCASE_CMAKE_HOST_SYSTEM
     set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "-Wl,--no-keep-memory ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
 endif ()
 
+if (UNIX AND NOT APPLE)
+    set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
+endif ()
+
 set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
 
 set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Where to install libraries (lib${LIB_SUFFIX})")
index 7221040..c955587 100644 (file)
@@ -1,3 +1,16 @@
+2013-07-16  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [CMake] Undefined references should be detected at build time
+        https://bugs.webkit.org/show_bug.cgi?id=110236
+
+        Reviewed by Christophe Dumez.
+
+        Add library dependencies that were not defined explicitly before.
+
+        * DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
+        * TestWebKitAPI/CMakeLists.txt:
+        * WebKitTestRunner/CMakeLists.txt:
+
 2013-07-16  Kwang Yul Seo  <skyul@company100.net>
 
         check-webkit-style: "using namespace foo;" should be flagged as an error only in headers
index c79e14d..5120323 100644 (file)
@@ -37,4 +37,9 @@ set(WebKitTestNetscapePlugin_INCLUDE_DIRECTORIES
 
 include_directories(${WebKitTestNetscapePlugin_INCLUDE_DIRECTORIES})
 
+set(WebKitTestNetscapePlugin_LIBRARIES
+    ${X11_LIBRARIES}
+)
+
 add_library(TestNetscapePlugin SHARED ${WebKitTestNetscapePlugin_SOURCES})
+target_link_libraries(TestNetscapePlugin ${WebKitTestNetscapePlugin_LIBRARIES})
index 072524c..23f2184 100644 (file)
@@ -55,8 +55,13 @@ add_library(TestWebKitAPIInjectedBundle SHARED
     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
 )
 
-target_link_libraries(TestWebKitAPIInjectedBundle WTF)
-add_dependencies(TestWebKitAPIInjectedBundle WebKit2 ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+set(TestWebKitAPI_LIBRARIES
+    WTF
+    WebKit2
+)
+
+target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
+add_dependencies(TestWebKitAPIInjectedBundle ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
 
 get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
 
index 8afd059..07b647b 100644 (file)
@@ -79,6 +79,16 @@ set(WebKitTestRunnerInjectedBundle_IDL_FILES
     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/TextInputController.idl"
 )
 
+set(WebKitTestRunnerInjectedBundle_LIBRARIES
+    ${WebKitTestRunner_LIBRARIES}
+    ${ATK_LIBRARIES}
+    ${ECORE_LIBRARIES}
+    ${ECORE_FILE_LIBRARIES}
+    ${FONTCONFIG_LIBRARIES}
+    ${GLIB_LIBRARIES}
+    ${GLIB_GOBJECT_LIBRARIES}
+)
+
 GENERATE_BINDINGS(WebKitTestRunnerInjectedBundle_SOURCES
     "${WebKitTestRunnerInjectedBundle_IDL_FILES}"
     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
@@ -92,7 +102,7 @@ INCLUDE_IF_EXISTS(${WEBKIT_TESTRUNNER_DIR}/Platform${PORT}.cmake)
 include_directories(${WebKitTestRunner_INCLUDE_DIRECTORIES})
 
 add_library(TestRunnerInjectedBundle SHARED ${WebKitTestRunnerInjectedBundle_SOURCES})
-target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunner_LIBRARIES})
+target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunnerInjectedBundle_LIBRARIES})
 
 add_executable(WebKitTestRunner ${WebKitTestRunner_SOURCES})
 target_link_libraries(WebKitTestRunner ${WebKitTestRunner_LIBRARIES})