https://bugs.webkit.org/show_bug.cgi?id=130260
Reviewed by Martin Robinson.
.:
* Source/PlatformGTK.cmake: Run the generate-gtkdoc script with the CFLAGS env set
to the list C compiler flags as constructed by CMake.
* Source/cmake/OptionsCommon.cmake: When building with Clang, use the -Qunused-arguments
compiler option to suppress verbose warnings about arguments that went unused by the driver.
* Source/cmake/OptionsGTK.cmake: Use -fno-omit-frame-pointer for both GCC and Clang.
-fno-tree-dce should be used only for GCC.
* Source/cmake/gtest/CMakeLists.txt: When building with Clang the GTest framework
should be built with GTEST_HAS_TR1_TUPLE macro defined to 0 to avoid build failures.
Tools:
* TestWebKitAPI/CMakeLists.txt: When building with Clang TestWebKitAPI should be
built with GTEST_HAS_TR1_TUPLE defined to 0 to avoid build failures occuring in the
included GTest framework headers.
* gtk/generate-gtkdoc:
(prepare_environment_for_gtkdoc_generation): Don't modify the CFLAGS env anymore
in case of using Clang since that is now set by the CMake rule.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165975
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-20 Zan Dobersek <zdobersek@igalia.com>
+
+ [GTK][CMake] Add support for building with Clang
+ https://bugs.webkit.org/show_bug.cgi?id=130260
+
+ Reviewed by Martin Robinson.
+
+ * Source/PlatformGTK.cmake: Run the generate-gtkdoc script with the CFLAGS env set
+ to the list C compiler flags as constructed by CMake.
+ * Source/cmake/OptionsCommon.cmake: When building with Clang, use the -Qunused-arguments
+ compiler option to suppress verbose warnings about arguments that went unused by the driver.
+ * Source/cmake/OptionsGTK.cmake: Use -fno-omit-frame-pointer for both GCC and Clang.
+ -fno-tree-dce should be used only for GCC.
+ * Source/cmake/gtest/CMakeLists.txt: When building with Clang the GTest framework
+ should be built with GTEST_HAS_TR1_TUPLE macro defined to 0 to avoid build failures.
+
2014-03-20 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r165962.
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
DEPENDS ${DocumentationDependencies}
- COMMAND CC="${CMAKE_C_COMPILER}" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
COMMAND touch ${_stamp_name}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
endif ()
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments")
+endif ()
+
string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)")
# To avoid out of memory when building with debug option in 32bit system.
set(SHOULD_INSTALL_JS_SHELL ON)
# Push of rbp is needed after JSC JIT uses CStack. See http://wkbug.com/127777.
-if (CMAKE_COMPILER_IS_GNUCC AND UNIX AND NOT APPLE)
- set(CMAKE_C_FLAGS_RELEASE "-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_C_FLAGS_RELEASE}")
- set(CMAKE_CXX_FLAGS_RELEASE "-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_CXX_FLAGS_RELEASE}")
+if (UNIX AND NOT APPLE)
+ if (CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_C_FLAGS_RELEASE "-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_C_FLAGS_RELEASE}")
+ set(CMAKE_CXX_FLAGS_RELEASE "-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
+ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ set(CMAKE_C_FLAGS_RELEASE "-fno-omit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}")
+ set(CMAKE_CXX_FLAGS_RELEASE "-fno-omit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
endif ()
# Add a typelib file to the list of all typelib dependencies. This makes it easy to
add_definitions(-DGTEST_CREATE_SHARED_LIBRARY=1 -DGTEST_HAS_RTTI=0)
+# FIXME: This works around compatibility problems in the old version of the third-pary
+# googletest source code checkout. It should be removed once we upgrade to a newer version.
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
+endif ()
+
+
target_link_libraries(gtest
WTF
)
+2014-03-20 Zan Dobersek <zdobersek@igalia.com>
+
+ [GTK][CMake] Add support for building with Clang
+ https://bugs.webkit.org/show_bug.cgi?id=130260
+
+ Reviewed by Martin Robinson.
+
+ * TestWebKitAPI/CMakeLists.txt: When building with Clang TestWebKitAPI should be
+ built with GTEST_HAS_TR1_TUPLE defined to 0 to avoid build failures occuring in the
+ included GTest framework headers.
+ * gtk/generate-gtkdoc:
+ (prepare_environment_for_gtkdoc_generation): Don't modify the CFLAGS env anymore
+ in case of using Clang since that is now set by the CMake rule.
+
2014-03-19 Simon Fraser <simon.fraser@apple.com>
Expose text and page zoom in WK2 SPI, and hook them up in MiniBrowser
-DTEST_INJECTED_BUNDLE_PATH=\"${TestWebKitAPIInjectedBundle_PATH}\"
)
+# FIXME: This works around compatibility problems in the old version of the third-pary
+# googletest source code checkout. It should be removed once we upgrade to a newer version.
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
+endif ()
+
add_executable(TestWTF
${test_main_SOURCES}
${TESTWEBKITAPI_DIR}/TestsController.cpp
cflags += ' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'
os.environ['CFLAGS'] = cflags
- # Clang can be noisy, throwing unnecessary warnings for unused arguments.
- if os.environ.get('CC') == "clang":
- os.environ['CFLAGS'] += ' -Qunused-arguments'
-
# Paths from the GNUmakefile generated configuration files are relative to the build directory.
os.chdir(common.build_path())