[CMake] Autogenerate cmakeconfig.h.cmake
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 20:30:15 +0000 (20:30 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 20:30:15 +0000 (20:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143997

Reviewed by Csaba Osztrogonác.

.:

* CMakeLists.txt: Create the configuration header as the last part of the cmake run.
* Source/CMakeLists.txt: No longer use configure_file to create cmakeconfig.h.
* Source/cmake/OptionsCommon.cmake: Expose WTF_CPU_ARM64_CORTEXA53 to the build explicitly.
* Source/cmake/OptionsGTK.cmake: Expose variables to the build using SET_AND_EXPOSE_TO_BUILD.
Do some other miscellaneous related cleanup.
* Source/cmake/OptionsEFL.cmake: Expose HAVE_LLVM to the build.
* Source/cmake/WebKitFeatures.cmake: Expose all WebKit features to the build. Add support for
build exposed variables. Add a macro to generate a configuration from them.
* Source/cmakeconfig.h.cmake: Removed.

Source/WebCore:

* PlatformGTK.cmake: Use the WTF_USE style variables, because those are the same
as the ones exposed to the build.

Source/WTF:

* wtf/Platform.h: Move a GTK-specific setting from cmakeconfig.h to here.

Tools:

* DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt: Add XP_UNIX to the command-line
definitions since TestNetscapePlugIn does not use cmakeconfig.h.

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

14 files changed:
CMakeLists.txt
ChangeLog
Source/CMakeLists.txt
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/cmake/OptionsCommon.cmake
Source/cmake/OptionsEfl.cmake
Source/cmake/OptionsGTK.cmake
Source/cmake/WebKitFeatures.cmake
Source/cmakeconfig.h.cmake [deleted file]
Tools/ChangeLog
Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt

index 26d5c1f..61733c0 100644 (file)
@@ -183,3 +183,8 @@ endif ()
 # Print the features list last, for maximum visibility.
 # -----------------------------------------------------------------------------
 PRINT_WEBKIT_OPTIONS()
+
+# -----------------------------------------------------------------------------
+# Create the configuration header
+# -----------------------------------------------------------------------------
+CREATE_CONFIGURATION_HEADER()
index e364b72..b637d0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2015-04-22  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Autogenerate cmakeconfig.h.cmake
+        https://bugs.webkit.org/show_bug.cgi?id=143997
+
+        Reviewed by Csaba Osztrogonác.
+
+        * CMakeLists.txt: Create the configuration header as the last part of the cmake run.
+        * Source/CMakeLists.txt: No longer use configure_file to create cmakeconfig.h.
+        * Source/cmake/OptionsCommon.cmake: Expose WTF_CPU_ARM64_CORTEXA53 to the build explicitly.
+        * Source/cmake/OptionsGTK.cmake: Expose variables to the build using SET_AND_EXPOSE_TO_BUILD.
+        Do some other miscellaneous related cleanup.
+        * Source/cmake/OptionsEFL.cmake: Expose HAVE_LLVM to the build.
+        * Source/cmake/WebKitFeatures.cmake: Expose all WebKit features to the build. Add support for
+        build exposed variables. Add a macro to generate a configuration from them.
+        * Source/cmakeconfig.h.cmake: Removed.
+
 2015-04-24  Philippe Normand  <pnormand@igalia.com>
 
         [JHBuild] Move to upstream OpenWebRTC
index 68cf801..eeaa32d 100644 (file)
@@ -42,8 +42,3 @@ endif ()
 if (ENABLE_WEBKIT2)
     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebKit2 ${ADDITIONAL_COMPILER_FLAGS})
 endif ()
-
-# -----------------------------------------------------------------------------
-# Create the configuration file
-# -----------------------------------------------------------------------------
-configure_file(cmakeconfig.h.cmake ${CMAKE_BINARY_DIR}/cmakeconfig.h @ONLY)
index 28f2dd1..9ada52e 100644 (file)
@@ -1,3 +1,12 @@
+2015-04-22  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Autogenerate cmakeconfig.h.cmake
+        https://bugs.webkit.org/show_bug.cgi?id=143997
+
+        Reviewed by Csaba Osztrogonác.
+
+        * wtf/Platform.h: Move a GTK-specific setting from cmakeconfig.h to here.
+
 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
 
         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
index 9c2de6b..2ec148d 100644 (file)
 #define WTF_USE_WEBP 1
 #endif
 
+#if PLATFORM(GTK) && !defined(GTK_API_VERSION_2)
+#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6
+#endif
+
 /* On Windows, use QueryPerformanceCounter by default */
 #if OS(WINDOWS)
 #define WTF_USE_QUERY_PERFORMANCE_COUNTER  1
index ccba621..a93ba1a 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-22  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Autogenerate cmakeconfig.h.cmake
+        https://bugs.webkit.org/show_bug.cgi?id=143997
+
+        Reviewed by Csaba Osztrogonác.
+
+        * PlatformGTK.cmake: Use the WTF_USE style variables, because those are the same
+        as the ones exposed to the build.
+
 2015-04-27  Zalan Bujtas  <zalan@apple.com>
 
         Simple line layout: Wrong text offsetting when range does not start from the first renderer.
index 0183011..87fe35b 100644 (file)
@@ -327,7 +327,7 @@ if (ENABLE_VIDEO)
         ${GSTREAMER_VIDEO_LIBRARIES}
     )
 
-    if (USE_GSTREAMER_MPEGTS)
+    if (WTF_USE_GSTREAMER_MPEGTS)
         list(APPEND WebCore_INCLUDE_DIRECTORIES
             ${GSTREAMER_MPEGTS_INCLUDE_DIRS}
         )
@@ -337,7 +337,7 @@ if (ENABLE_VIDEO)
         )
     endif ()
 
-    if (USE_GSTREAMER_GL)
+    if (WTF_USE_GSTREAMER_GL)
         list(APPEND WebCore_INCLUDE_DIRECTORIES
             ${GSTREAMER_GL_INCLUDE_DIRS}
         )
index 601881d..8621dee 100644 (file)
@@ -65,6 +65,8 @@ if (WTF_CPU_ARM64_CORTEXA53)
     endif ()
 endif ()
 
+EXPOSE_VARIABLE_TO_BUILD(WTF_CPU_ARM64_CORTEXA53)
+
 # Use ld.gold if it is available and isn't disabled explicitly
 option(USE_LD_GOLD "Use GNU gold linker" ON)
 if (USE_LD_GOLD)
index e503eee..32ed89e 100644 (file)
@@ -288,7 +288,7 @@ if (ENABLE_FTL_JIT)
     else ()
         message(FATAL_ERROR "FTL JIT is only available on X86_64 and AArch64 architectures.")
     endif ()
-    set(HAVE_LLVM ON)
+    SET_AND_EXPOSE_TO_BUILD(HAVE_LLVM TRUE)
     if (ENABLE_FTL_NATIVE_CALL_INLINING)
         find_package(Clang REQUIRED)
     endif ()
index 34357a4..9920078 100644 (file)
@@ -135,6 +135,8 @@ else ()
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC OFF)
 endif ()
 
+# FIXME: There is no reason these should be different.
+SET_AND_EXPOSE_TO_BUILD(DEVELOPMENT_BUILD ${DEVELOPER_MODE})
 if (DEVELOPER_MODE)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MINIBROWSER PUBLIC ON)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PUBLIC ON)
@@ -198,6 +200,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_QUOTA PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOLUTION_MEDIA_QUERY PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REQUEST_ANIMATION_FRAME PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SECCOMP_FILTERS PRIVATE OFF)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SMOOTH_SCROLLING PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TEMPLATE_ELEMENT PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USERSELECT_ALL PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USER_MESSAGE_HANDLERS PRIVATE ON)
@@ -210,34 +213,20 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THREADED_COMPOSITOR PRIVATE OFF)
 WEBKIT_OPTION_END()
 
-if (LIBNOTIFY_FOUND)
-    add_definitions(-DWTF_USE_LIBNOTIFY=1)
-else ()
-    add_definitions(-DWTF_USE_LIBNOTIFY=0)
-endif ()
-
 if (ENABLE_PLUGIN_PROCESS_GTK2)
     find_package(GTK2 2.24.10 REQUIRED)
     find_package(GDK2 2.24.10 REQUIRED)
-    add_definitions(-DENABLE_PLUGIN_PROCESS_GTK2=1)
 endif ()
 
-if (ENABLE_X11_TARGET)
-    add_definitions(-DWTF_PLATFORM_X11=1)
-    add_definitions(-DMOZ_X11=1)
-    if (WTF_OS_UNIX)
-        add_definitions(-DXP_UNIX)
-    endif ()
-endif ()
-
-if (ENABLE_WAYLAND_TARGET)
-    add_definitions(-DWTF_PLATFORM_WAYLAND=1)
-endif ()
+SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBNOTIFY ${LIBNOTIFY_FOUND})
+SET_AND_EXPOSE_TO_BUILD(WTF_PLATFORM_X11 ${ENABLE_X11_TARGET})
+SET_AND_EXPOSE_TO_BUILD(MOZ_X11 ${ENABLE_X11_TARGET})
+SET_AND_EXPOSE_TO_BUILD(XP_UNIX ${WTF_OS_UNIX})
+SET_AND_EXPOSE_TO_BUILD(WTF_PLATFORM_WAYLAND ${ENABLE_WAYLAND_TARGET})
 
 set(ENABLE_WEBKIT OFF)
 set(ENABLE_WEBKIT2 ON)
 set(ENABLE_PLUGIN_PROCESS ON)
-set(ENABLE_SMOOTH_SCROLLING ON)
 
 set(GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6)
 set(GTK_API_VERSION 3.0)
@@ -263,27 +252,22 @@ add_definitions(-DUSER_AGENT_GTK_MAJOR_VERSION=601)
 add_definitions(-DUSER_AGENT_GTK_MINOR_VERSION=1)
 add_definitions(-DWEBKITGTK_API_VERSION_STRING="${WEBKITGTK_API_VERSION}")
 
-if (DEVELOPER_MODE)
-    add_definitions(-DDEVELOPMENT_BUILD=1)
-endif ()
-
 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
     set(GSTREAMER_COMPONENTS app pbutils)
-    add_definitions(-DWTF_USE_GSTREAMER)
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_GSTREAMER TRUE)
     if (ENABLE_VIDEO)
         list(APPEND GSTREAMER_COMPONENTS video mpegts tag gl)
     endif ()
 
     if (ENABLE_WEB_AUDIO)
         list(APPEND GSTREAMER_COMPONENTS audio fft)
-        add_definitions(-DWTF_USE_WEBAUDIO_GSTREAMER)
+        SET_AND_EXPOSE_TO_BUILD(WTF_USE_WEBAUDIO_GSTREAMER TRUE)
     endif ()
 
     find_package(GStreamer 1.0.3 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
 
     if (PC_GSTREAMER_MPEGTS_FOUND)
-        add_definitions(-DWTF_USE_GSTREAMER_MPEGTS)
-        set(USE_GSTREAMER_MPEGTS TRUE)
+        SET_AND_EXPOSE_TO_BUILD(WTF_USE_GSTREAMER_MPEGTS TRUE)
     endif ()
 endif ()
 
@@ -307,32 +291,22 @@ endif ()
 find_package(GLIB 2.33.2 REQUIRED COMPONENTS ${glib_components})
 
 if (ENABLE_GEOLOCATION)
-    if (GEOCLUE2_FOUND)
-      set(WTF_USE_GEOCLUE2 1)
-    else ()
-      set(WTF_USE_GEOCLUE2 0)
-    endif ()
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_GEOCLUE2 ${GEOCLUE2_FOUND})
 endif ()
 
 if (ENABLE_MEDIA_STREAM)
     find_package(OpenWebRTC)
-    if (OPENWEBRTC_FOUND)
-        add_definitions(-DWTF_USE_OPENWEBRTC)
-    endif ()
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_OPENWEBRTC ${OPENWEBRTC_FOUND})
 endif ()
 
 find_package(GTKUnixPrint)
-if (GTK_UNIX_PRINT_FOUND)
-    set(HAVE_GTK_UNIX_PRINTING 1)
-endif ()
+SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_UNIX_PRINTING ${GTK_UNIX_PRINT_FOUND})
 
 if (ENABLE_CREDENTIAL_STORAGE)
     find_package(Libsecret REQUIRED)
 endif ()
 
-if (GTK_SUPPORTS_GESTURES)
-    add_definitions(-DHAVE_GTK_GESTURES=1)
-endif ()
+SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_GESTURES ${GTK_SUPPORTS_GESTURES})
 
 # This part can be simplified once CMake 2.8.6 is required and
 # CMakePushCheckState can be used. We need to have OPENGL_INCLUDE_DIR as part
@@ -342,14 +316,6 @@ if (ENABLE_X11_TARGET)
     set(REQUIRED_INCLUDES_OLD ${CMAKE_REQUIRED_INCLUDES})
     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIR})
     set(CMAKE_REQUIRED_INCLUDES ${REQUIRED_INCLUDES_OLD})
-
-    if (GLX_FOUND)
-        set(WTF_USE_GLX 1)
-    endif ()
-endif ()
-
-if (EGL_FOUND)
-    set(WTF_USE_EGL 1)
 endif ()
 
 if (ENABLE_SPELLCHECK)
@@ -358,43 +324,30 @@ endif ()
 
 if ((OPENGL_FOUND OR OPENGLES2_FOUND) AND (GLX_FOUND OR EGL_FOUND))
     set(ENABLE_TEXTURE_MAPPER 1)
-    set(WTF_USE_3D_GRAPHICS 1)
 
-    add_definitions(-DWTF_USE_3D_GRAPHICS=1)
-    add_definitions(-DWTF_USE_TEXTURE_MAPPER=1)
-    add_definitions(-DWTF_USE_TEXTURE_MAPPER_GL=1)
-    add_definitions(-DENABLE_3D_RENDERING=1)
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_3D_GRAPHICS TRUE)
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_TEXTURE_MAPPER TRUE)
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_TEXTURE_MAPPER_GL TRUE)
+    set(ENABLE_3D_RENDERING ON) # This is already exposed by WEBKIT_OPTION_DEFINE.
 
     if (ENABLE_X11_TARGET AND USE_REDIRECTED_XCOMPOSITE_WINDOW)
         add_definitions(-DWTF_USE_REDIRECTED_XCOMPOSITE_WINDOW=1)
     endif ()
 
     if (OPENGLES2_FOUND)
-        set(WTF_USE_OPENGL_ES_2 1)
-        add_definitions(-DWTF_USE_OPENGL_ES_2=1)
+        SET_AND_EXPOSE_TO_BUILD(WTF_USE_OPENGL_ES_2 TRUE)
     else ()
-        set(WTF_USE_OPENGL 1)
-        add_definitions(-DWTF_USE_OPENGL=1)
-    endif ()
-
-    if (EGL_FOUND)
-        add_definitions(-DWTF_USE_EGL=1)
+        SET_AND_EXPOSE_TO_BUILD(WTF_USE_OPENGL TRUE)
     endif ()
 
-    if (GLX_FOUND)
-        add_definitions(-DWTF_USE_GLX=1)
-    endif ()
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_EGL ${EGL_FOUND})
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_GLX ${GLX_FOUND})
 
-    if (ENABLE_THREADED_COMPOSITOR)
-        add_definitions(-DWTF_USE_TILED_BACKING_STORE=1)
-        add_definitions(-DWTF_USE_COORDINATED_GRAPHICS=1)
-        add_definitions(-DWTF_USE_COORDINATED_GRAPHICS_THREADED=1)
-    endif ()
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_TILED_BACKING_STORE ${ENABLE_THREADED_COMPOSITOR})
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_COORDINATED_GRAPHICS ${ENABLE_THREADED_COMPOSITOR})
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_COORDINATED_GRAPHICS_THREADED ${ENABLE_THREADED_COMPOSITOR})
 
-    if (PC_GSTREAMER_GL_FOUND)
-        add_definitions(-DWTF_USE_GSTREAMER_GL)
-        set(USE_GSTREAMER_GL TRUE)
-    endif ()
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_GSTREAMER_GL ${PC_GSTREAMER_GL_FOUND})
 endif ()
 
 if (ENABLE_GAMEPAD_DEPRECATED)
@@ -403,7 +356,7 @@ endif ()
 
 if (ENABLE_FTL_JIT)
     find_package(LLVM REQUIRED)
-    set(HAVE_LLVM ON)
+    SET_AND_EXPOSE_TO_BUILD(HAVE_LLVM TRUE)
 endif ()
 
 set(CPACK_SOURCE_GENERATOR TBZ2)
index 5df3a58..88fb36f 100644 (file)
@@ -9,6 +9,7 @@ macro(WEBKIT_OPTION_DEFINE _name _description _public _initial_value)
     set(_WEBKIT_AVAILABLE_OPTIONS_INITIAL_VALUE_${_name} ${_initial_value})
     set(_WEBKIT_AVAILABLE_OPTIONS_${_name}_DEPENDENCIES "")
     list(APPEND _WEBKIT_AVAILABLE_OPTIONS ${_name})
+    EXPOSE_VARIABLE_TO_BUILD(${_name})
 endmacro()
 
 macro(WEBKIT_OPTION_DEFAULT_PORT_VALUE _name _public _value)
@@ -80,6 +81,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_ICONDATABASE "Toggle Icon database support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_IMAGE_DECODER_DOWN_SAMPLING "Toggle image decoder down sampling support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_INDEXED_DATABASE "Toggle Indexed Database API support" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_INDEXED_DATABASE_IN_WORKERS "Toggle support for indexed database in workers" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_INDIE_UI "Toggle Indie UI support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_INPUT_TYPE_COLOR "Toggle Color Input support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_INPUT_TYPE_COLOR_POPOVER "Toggle popover color input support" PRIVATE OFF)
@@ -132,6 +134,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_SATURATED_LAYOUT_ARITHMETIC "Toggle saturated layout arithmetic support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_SECCOMP_FILTERS "Toggle Linux seccomp filters for the WebProcess support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SERVICE_CONTROLS "Toggle service controls support" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_SMOOTH_SCROLLING "Toggle smooth scrolling" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SPEECH_SYNTHESIS "Toggle Speech Synthesis API support)" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SPELLCHECK "Toggle Spellchecking support (requires Enchant)" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_STREAMS_API "Toggle Streams API support" PRIVATE ON)
@@ -239,3 +242,44 @@ macro(PRINT_WEBKIT_OPTIONS)
         endif ()
     endforeach ()
 endmacro()
+
+set(_WEBKIT_CONFIG_FILE_VARIABLES "")
+
+macro(EXPOSE_VARIABLE_TO_BUILD _variable_name)
+    list(APPEND _WEBKIT_CONFIG_FILE_VARIABLES ${_variable_name})
+endmacro()
+
+macro(SET_AND_EXPOSE_TO_BUILD _variable_name)
+    # It's important to handle the case where the value isn't passed, because often
+    # during configuration an empty variable is the result of a failed package search.
+    if (${ARGC} GREATER 1)
+        set(_variable_value ${ARGV1})
+    else ()
+        set(_variable_value OFF)
+    endif ()
+
+    set(${_variable_name} ${_variable_value})
+    EXPOSE_VARIABLE_TO_BUILD(${_variable_name})
+endmacro()
+
+macro(CREATE_CONFIGURATION_HEADER)
+    list(SORT _WEBKIT_CONFIG_FILE_VARIABLES)
+    set(_file_contents "#ifndef CMAKECONFIG_H\n")
+    set(_file_contents "${_file_contents}#define CMAKECONFIG_H\n\n")
+    foreach (_variable_name ${_WEBKIT_CONFIG_FILE_VARIABLES})
+        if (${${_variable_name}})
+            set(_file_contents "${_file_contents}#define ${_variable_name} 1\n")
+        else ()
+            set(_file_contents "${_file_contents}#define ${_variable_name} 0\n")
+        endif ()
+    endforeach ()
+    set(_file_contents "${_file_contents}\n#endif /* CMAKECONFIG_H */\n")
+
+    file(WRITE "${CMAKE_BINARY_DIR}/cmakeconfig.h.tmp" "${_file_contents}")
+    execute_process(COMMAND ${CMAKE_COMMAND}
+        -E copy_if_different
+        "${CMAKE_BINARY_DIR}/cmakeconfig.h.tmp"
+        "${CMAKE_BINARY_DIR}/cmakeconfig.h"
+    )
+    file(REMOVE "${CMAKE_BINARY_DIR}/cmakeconfig.h.tmp")
+endmacro()
diff --git a/Source/cmakeconfig.h.cmake b/Source/cmakeconfig.h.cmake
deleted file mode 100644 (file)
index b79aadd..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef CMAKECONFIG_H
-#define CMAKECONFIG_H
-
-#cmakedefine01 ENABLE_3D_TRANSFORMS
-#cmakedefine01 ENABLE_ACCELERATED_2D_CANVAS
-#cmakedefine01 ENABLE_ACCELERATED_OVERFLOW_SCROLLING
-#cmakedefine01 ENABLE_ACCESSIBILITY
-#cmakedefine01 ENABLE_API_TESTS
-#cmakedefine01 ENABLE_ATTACHMENT_ELEMENT
-#cmakedefine01 ENABLE_AVF_CAPTIONS
-#cmakedefine01 ENABLE_ASSEMBLER_WX_EXCLUSIVE
-#cmakedefine01 ENABLE_BATTERY_STATUS
-#cmakedefine01 ENABLE_CACHE_PARTITIONING
-#cmakedefine01 ENABLE_CANVAS_PATH
-#cmakedefine01 ENABLE_CANVAS_PROXY
-#cmakedefine01 ENABLE_CHANNEL_MESSAGING
-#cmakedefine01 ENABLE_ES6_CLASS_SYNTAX
-#cmakedefine01 ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX
-#cmakedefine01 ENABLE_CONTENT_FILTERING
-#cmakedefine01 ENABLE_CONTEXT_MENUS
-#cmakedefine01 ENABLE_CREDENTIAL_STORAGE
-#cmakedefine01 ENABLE_CSP_NEXT
-#cmakedefine01 ENABLE_CSS3_TEXT
-#cmakedefine01 ENABLE_CSS3_TEXT_LINE_BREAK
-#cmakedefine01 ENABLE_CSS_BOX_DECORATION_BREAK
-#cmakedefine01 ENABLE_CSS_COMPOSITING
-#cmakedefine01 ENABLE_CSS_DEVICE_ADAPTATION
-#cmakedefine01 ENABLE_CSS_GRID_LAYOUT
-#cmakedefine01 ENABLE_CSS_IMAGE_ORIENTATION
-#cmakedefine01 ENABLE_CSS_IMAGE_RESOLUTION
-#cmakedefine01 ENABLE_CSS_IMAGE_SET
-#cmakedefine01 ENABLE_CSS_REGIONS
-#cmakedefine01 ENABLE_CSS_SCROLL_SNAP
-#cmakedefine01 ENABLE_CSS_SELECTORS_LEVEL4
-#cmakedefine01 ENABLE_CSS_SHAPES
-#cmakedefine01 ENABLE_CURSOR_VISIBILITY
-#cmakedefine01 ENABLE_CUSTOM_SCHEME_HANDLER
-#cmakedefine01 ENABLE_DASHBOARD_SUPPORT
-#cmakedefine01 ENABLE_DATACUE_VALUE
-#cmakedefine01 ENABLE_DATALIST_ELEMENT
-#cmakedefine01 ENABLE_DATA_TRANSFER_ITEMS
-#cmakedefine01 ENABLE_DETAILS_ELEMENT
-#cmakedefine01 ENABLE_DEVICE_ORIENTATION
-#cmakedefine01 ENABLE_DFG_JIT
-#cmakedefine01 ENABLE_DOM4_EVENTS_CONSTRUCTOR
-#cmakedefine01 ENABLE_DOWNLOAD_ATTRIBUTE
-#cmakedefine01 ENABLE_DRAG_SUPPORT
-#cmakedefine01 ENABLE_ENCRYPTED_MEDIA
-#cmakedefine01 ENABLE_ENCRYPTED_MEDIA_V2
-#cmakedefine01 ENABLE_FILTERS_LEVEL_2
-#cmakedefine01 ENABLE_FONT_LOAD_EVENTS
-#cmakedefine01 ENABLE_FTPDIR
-#cmakedefine01 ENABLE_FTL_JIT
-#cmakedefine01 ENABLE_FTL_NATIVE_CALL_INLINING
-#cmakedefine01 ENABLE_FULLSCREEN_API
-#cmakedefine01 ENABLE_GAMEPAD
-#cmakedefine01 ENABLE_GAMEPAD_DEPRECATED
-#cmakedefine01 ENABLE_GEOLOCATION
-#cmakedefine01 ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING
-#cmakedefine01 ENABLE_ICONDATABASE
-#cmakedefine01 ENABLE_IMAGE_DECODER_DOWN_SAMPLING
-#cmakedefine01 ENABLE_INDEXED_DATABASE
-#cmakedefine01 ENABLE_INDEXED_DATABASE_IN_WORKERS
-#cmakedefine01 ENABLE_INDIE_UI
-#cmakedefine01 ENABLE_INPUT_TYPE_COLOR
-#cmakedefine01 ENABLE_INPUT_TYPE_COLOR_POPOVER
-#cmakedefine01 ENABLE_INPUT_TYPE_DATE
-#cmakedefine01 ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE
-#cmakedefine01 ENABLE_INPUT_TYPE_DATETIMELOCAL
-#cmakedefine01 ENABLE_INPUT_TYPE_TIME
-#cmakedefine01 ENABLE_INPUT_TYPE_MONTH
-#cmakedefine01 ENABLE_INPUT_TYPE_WEEK
-#cmakedefine01 ENABLE_IOS_AIRPLAY
-#cmakedefine01 ENABLE_IOS_TEXT_AUTOSIZING
-#cmakedefine01 ENABLE_JIT
-#cmakedefine01 ENABLE_LEGACY_CSS_VENDOR_PREFIXES
-#cmakedefine01 ENABLE_LEGACY_NOTIFICATIONS
-#cmakedefine01 ENABLE_LEGACY_VENDOR_PREFIXES
-#cmakedefine01 ENABLE_LEGACY_WEB_AUDIO
-#cmakedefine01 ENABLE_LINK_PREFETCH
-#cmakedefine01 ENABLE_MAC_LONG_PRESS
-#cmakedefine01 ENABLE_MATHML
-#cmakedefine01 ENABLE_MEDIA_CAPTURE
-#cmakedefine01 ENABLE_MEDIA_CONTROLS_SCRIPT
-#cmakedefine01 ENABLE_MEDIA_SOURCE
-#cmakedefine01 ENABLE_MEDIA_STATISTICS
-#cmakedefine01 ENABLE_MEDIA_STREAM
-#cmakedefine01 ENABLE_MEMORY_SAMPLER
-#cmakedefine01 ENABLE_METER_ELEMENT
-#cmakedefine01 ENABLE_MHTML
-#cmakedefine01 ENABLE_MINIBROWSER
-#cmakedefine01 ENABLE_MOUSE_CURSOR_SCALE
-#cmakedefine01 ENABLE_NAVIGATOR_CONTENT_UTILS
-#cmakedefine01 ENABLE_NAVIGATOR_HWCONCURRENCY
-#cmakedefine01 ENABLE_NOSNIFF
-#cmakedefine01 ENABLE_NETSCAPE_PLUGIN_API
-#cmakedefine01 ENABLE_NETWORK_PROCESS
-#cmakedefine01 ENABLE_NOTIFICATIONS
-#cmakedefine01 ENABLE_ORIENTATION_EVENTS
-#cmakedefine01 ENABLE_PDFKIT_PLUGIN
-#cmakedefine01 ENABLE_PERFORMANCE_TIMELINE
-#cmakedefine01 ENABLE_PICTURE_SIZES
-#cmakedefine01 ENABLE_POINTER_LOCK
-#cmakedefine01 ENABLE_PROMISES
-#cmakedefine01 ENABLE_PROXIMITY_EVENTS
-#cmakedefine01 ENABLE_PUBLIC_SUFFIX_LIST
-#cmakedefine01 ENABLE_QUOTA
-#cmakedefine01 ENABLE_REMOTE_INSPECTOR
-#cmakedefine01 ENABLE_REQUEST_ANIMATION_FRAME
-#cmakedefine01 ENABLE_RESOLUTION_MEDIA_QUERY
-#cmakedefine01 ENABLE_RESOURCE_TIMING
-#cmakedefine01 ENABLE_SATURATED_LAYOUT_ARITHMETIC
-#cmakedefine01 ENABLE_SECCOMP_FILTERS
-#cmakedefine01 ENABLE_SERVICE_CONTROLS
-#cmakedefine01 ENABLE_SMOOTH_SCROLLING
-#cmakedefine01 ENABLE_SPELLCHECK
-#cmakedefine01 ENABLE_STREAMS_API
-#cmakedefine01 ENABLE_SUBTLE_CRYPTO
-#cmakedefine01 ENABLE_SVG_FONTS
-#cmakedefine01 ENABLE_TELEPHONE_NUMBER_DETECTION
-#cmakedefine01 ENABLE_TEMPLATE_ELEMENT
-#cmakedefine01 ENABLE_TEXT_AUTOSIZING
-#cmakedefine01 ENABLE_TOUCH_EVENTS
-#cmakedefine01 ENABLE_TOUCH_SLIDER
-#cmakedefine01 ENABLE_TOUCH_ICON_LOADING
-#cmakedefine01 ENABLE_USERSELECT_ALL
-#cmakedefine01 ENABLE_USER_MESSAGE_HANDLERS
-#cmakedefine01 ENABLE_USER_TIMING
-#cmakedefine01 ENABLE_VIBRATION
-#cmakedefine01 ENABLE_VIDEO
-#cmakedefine01 ENABLE_VIDEO_TRACK
-#cmakedefine01 ENABLE_VIEW_MODE_CSS_MEDIA
-#cmakedefine01 ENABLE_WEBGL
-#cmakedefine01 ENABLE_WEBVTT_REGIONS
-#cmakedefine01 ENABLE_WEB_AUDIO
-#cmakedefine01 ENABLE_WEB_REPLAY
-#cmakedefine01 ENABLE_WEB_SOCKETS
-#cmakedefine01 ENABLE_WEB_TIMING
-#cmakedefine01 ENABLE_XHR_TIMEOUT
-#cmakedefine01 ENABLE_XSLT
-#cmakedefine01 USE_SYSTEM_MALLOC
-#cmakedefine01 WTF_USE_GEOCLUE2
-#cmakedefine01 HAVE_LLVM
-#cmakedefine01 HAVE_GTK_UNIX_PRINTING
-#cmakedefine01 WTF_CPU_ARM64_CORTEXA53
-
-#if defined(BUILDING_GTK__) && !defined(GTK_API_VERSION_2)
-#define GDK_VERSION_MIN_REQUIRED @GDK_VERSION_MIN_REQUIRED@
-#endif
-
-#endif /* CMAKECONFIG_H */
index d6902ff..40dea14 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-22  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Autogenerate cmakeconfig.h.cmake
+        https://bugs.webkit.org/show_bug.cgi?id=143997
+
+        Reviewed by Csaba Osztrogonác.
+
+        * DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt: Add XP_UNIX to the command-line
+        definitions since TestNetscapePlugIn does not use cmakeconfig.h.
+
 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
 
         REGRESSION(r182879): Images and video can no longer be downloaded
index 78302df..55e6a4d 100644 (file)
@@ -42,6 +42,10 @@ set(WebKitTestNetscapePlugin_LIBRARIES
     ${X11_LIBRARIES}
 )
 
+if (WTF_OS_UNIX)
+    add_definitions(-DXP_UNIX)
+endif ()
+
 add_library(TestNetscapePlugin SHARED ${WebKitTestNetscapePlugin_SOURCES})
 target_link_libraries(TestNetscapePlugin ${WebKitTestNetscapePlugin_LIBRARIES})
 set_target_properties(TestNetscapePlugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins)