https://bugs.webkit.org/show_bug.cgi?id=144557
Patch by Philip Chimento <philip.chimento@gmail.com> on 2015-10-12
Reviewed by Martin Robinson.
.:
* Source/cmake/OptionsGTK.cmake: Turn the macro
ADD_WHOLE_ARCHIVE_TO_LIBRARIES into a no-op on Darwin systems,
because XCode's linker doesn't have the --whole-archive option.
Source/WebKit2:
* PlatformGTK.cmake: Link with extra libraries on Darwin, since
we don't have the --whole-archive linker option.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190909
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-10-12 Philip Chimento <philip.chimento@gmail.com>
+
+ [GTK] OSX linker doesn't understand --whole-archive
+ https://bugs.webkit.org/show_bug.cgi?id=144557
+
+ Reviewed by Martin Robinson.
+
+ * Source/cmake/OptionsGTK.cmake: Turn the macro
+ ADD_WHOLE_ARCHIVE_TO_LIBRARIES into a no-op on Darwin systems,
+ because XCode's linker doesn't have the --whole-archive option.
+
2015-10-12 Philip Chimento <philip.chimento@gmail.com>
[GTK] Use --version-script only on Linux
+2015-10-12 Philip Chimento <philip.chimento@gmail.com>
+
+ [GTK] OSX linker doesn't understand --whole-archive
+ https://bugs.webkit.org/show_bug.cgi?id=144557
+
+ Reviewed by Martin Robinson.
+
+ * PlatformGTK.cmake: Link with extra libraries on Darwin, since
+ we don't have the --whole-archive linker option.
+
2015-10-09 Anders Carlsson <andersca@apple.com>
Don't allow plug-ins to override image types for <embed> elements
${WEBKIT2_DIR}/UIProcess/API/gtk/*.cpp
)
+# Manually add some libraries on OSX because we don't have the --whole-archive flag
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ set(INTROSPECTION_ADDITIONAL_LIBRARIES --library=c++)
+ set(INTROSPECTION_ADDITIONAL_LDFLAGS -lGObjectDOMBindings)
+endif ()
+
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations
+ LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
${INTROSPECTION_SCANNER}
--quiet
--include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
--library=webkit2gtk-${WEBKITGTK_API_VERSION}
--library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
+ ${INTROSPECTION_ADDITIONAL_LIBRARIES}
-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
--no-libtool
# CMake does not automatically add --whole-archive when building shared objects from
# a list of convenience libraries. This can lead to missing symbols in the final output.
# We add --whole-archive to all libraries manually to prevent the linker from trimming
-# symbols that we actually need later.
+# symbols that we actually need later. (--whole-archive isn't an option on XCode's
+# linker, though.)
macro(ADD_WHOLE_ARCHIVE_TO_LIBRARIES _list_name)
- foreach (library IN LISTS ${_list_name})
- list(APPEND ${_list_name}_TMP -Wl,--whole-archive ${library} -Wl,--no-whole-archive)
- endforeach ()
- set(${_list_name} "${${_list_name}_TMP}")
+ if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ foreach (library IN LISTS ${_list_name})
+ list(APPEND ${_list_name}_TMP -Wl,--whole-archive ${library} -Wl,--no-whole-archive)
+ endforeach ()
+ set(${_list_name} "${${_list_name}_TMP}")
+ endif ()
endmacro()
if (CMAKE_MAJOR_VERSION LESS 3)