Title: [183626] trunk
Revision
183626
Author
mrobin...@webkit.org
Date
2015-04-30 09:17:08 -0700 (Thu, 30 Apr 2015)

Log Message

[CMake] Automatically expose WTF_USE_FOO to the build when USE_FOO is exposed
https://bugs.webkit.org/show_bug.cgi?id=144394

Reviewed by Carlos Garcia Campos.

Automatically expose WTF_USE_FOO when USE_FOO is exposed. A side-effect of this change
is that it fixes the redirected XComposite window for GTK+, which was accidentally
disabled in previous reworking of the CMake configuration.

* Source/cmake/OptionsGTK.cmake: We no longer need to expose the WTF_ prefixed
version of USE variables.
* Source/cmake/WebKitFeatures.cmake: Automatically expose WTF_USE_FOO when USE_FOO
is exposed to the build.

Modified Paths

Diff

Modified: trunk/ChangeLog (183625 => 183626)


--- trunk/ChangeLog	2015-04-30 08:54:05 UTC (rev 183625)
+++ trunk/ChangeLog	2015-04-30 16:17:08 UTC (rev 183626)
@@ -1,3 +1,19 @@
+2015-04-30  Martin Robinson  <mrobin...@igalia.com>
+
+        [CMake] Automatically expose WTF_USE_FOO to the build when USE_FOO is exposed
+        https://bugs.webkit.org/show_bug.cgi?id=144394
+
+        Reviewed by Carlos Garcia Campos.
+
+        Automatically expose WTF_USE_FOO when USE_FOO is exposed. A side-effect of this change
+        is that it fixes the redirected XComposite window for GTK+, which was accidentally
+        disabled in previous reworking of the CMake configuration.
+
+        * Source/cmake/OptionsGTK.cmake: We no longer need to expose the WTF_ prefixed
+        version of USE variables.
+        * Source/cmake/WebKitFeatures.cmake: Automatically expose WTF_USE_FOO when USE_FOO
+        is exposed to the build.
+
 2015-04-30  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Bump GTK+ version numbers.

Modified: trunk/Source/cmake/OptionsGTK.cmake (183625 => 183626)


--- trunk/Source/cmake/OptionsGTK.cmake	2015-04-30 08:54:05 UTC (rev 183625)
+++ trunk/Source/cmake/OptionsGTK.cmake	2015-04-30 16:17:08 UTC (rev 183626)
@@ -352,14 +352,12 @@
         if (NOT PC_GSTREAMER_MPEGTS_FOUND)
             message(FATAL_ERROR "GStreamer MPEG-TS is needed for USE_GSTREAMER_MPEGTS.")
         endif ()
-        SET_AND_EXPOSE_TO_BUILD(WTF_USE_GSTREAMER_MPEGTS TRUE)
     endif ()
 
     if (USE_GSTREAMER_GL)
         if (NOT PC_GSTREAMER_GL_FOUND)
             message(FATAL_ERROR "GStreamerGL is needed for USE_GSTREAMER_GL.")
         endif ()
-        SET_AND_EXPOSE_TO_BUILD(WTF_USE_GSTREAMER_GL TRUE)
     endif ()
 endif ()
 
@@ -376,7 +374,6 @@
     if (NOT LIBNOTIFY_FOUND)
        message(FATAL_ERROR "libnotify is needed for USE_LIBNOTIFY.")
     endif ()
-    SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBNOTIFY TRUE)
 endif ()
 
 if (USE_LIBHYPHEN)
@@ -384,7 +381,6 @@
     if (NOT HYPHEN_FOUND)
        message(FATAL_ERROR "libhyphen is needed for USE_LIBHYPHEN.")
     endif ()
-    SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBHYPHEN 1)
 endif ()
 
 set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)

Modified: trunk/Source/cmake/WebKitFeatures.cmake (183625 => 183626)


--- trunk/Source/cmake/WebKitFeatures.cmake	2015-04-30 08:54:05 UTC (rev 183625)
+++ trunk/Source/cmake/WebKitFeatures.cmake	2015-04-30 16:17:08 UTC (rev 183626)
@@ -290,15 +290,28 @@
     EXPOSE_VARIABLE_TO_BUILD(${_variable_name})
 endmacro()
 
+macro(_ADD_CONFIGURATION_LINE_TO_HEADER_STRING _string _variable_name _output_variable_name)
+    if (${${_variable_name}})
+        set(${_string} "${_file_contents}#define ${_output_variable_name} 1\n")
+    else ()
+        set(${_string} "${_file_contents}#define ${_output_variable_name} 0\n")
+    endif ()
+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")
+        _ADD_CONFIGURATION_LINE_TO_HEADER_STRING(_file_contents ${_variable_name} ${_variable_name})
+
+        # WebKit looks for WTF_USE_FOO when calling the USE(FOO) macro. Automatically exposing
+        # this definition when USE_FOO is exposed, prevents us from having to expose both (or
+        # forgetting to do so).
+        string(FIND ${_variable_name} "USE_" _use_string_location)
+        if (${_use_string_location} EQUAL 0)
+            _ADD_CONFIGURATION_LINE_TO_HEADER_STRING(_file_contents ${_variable_name} "WTF_${_variable_name}")
         endif ()
     endforeach ()
     set(_file_contents "${_file_contents}\n#endif /* CMAKECONFIG_H */\n")
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to