[CMake] Print sorted feature list at the very end of the configure process
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Apr 2015 21:28:34 +0000 (21:28 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Apr 2015 21:28:34 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143596

Reviewed by Martin Robinson.

* CMakeLists.txt: Call PRINT_WEBKIT_OPTIONS at the bottom of the file.
* Source/cmake/WebKitFeatures.cmake: Split option printing into PRINT_WEBKIT_OPTIONS macro,
and sort the options before printing. Reorder some code so that features still get
propagated to the bindings generators.

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

CMakeLists.txt
ChangeLog
Source/cmake/WebKitFeatures.cmake

index e22d6d7..3277f61 100644 (file)
@@ -178,3 +178,8 @@ add_subdirectory(Source)
 if (ENABLE_TOOLS)
     add_subdirectory(Tools)
 endif ()
+
+# -----------------------------------------------------------------------------
+# Print the features list last, for maximum visibility.
+# -----------------------------------------------------------------------------
+PRINT_WEBKIT_OPTIONS()
index 33dd8ed..e2743df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2015-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>
 
+        [CMake] Print sorted feature list at the very end of the configure process
+        https://bugs.webkit.org/show_bug.cgi?id=143596
+
+        Reviewed by Martin Robinson.
+
+        * CMakeLists.txt: Call PRINT_WEBKIT_OPTIONS at the bottom of the file.
+        * Source/cmake/WebKitFeatures.cmake: Split option printing into PRINT_WEBKIT_OPTIONS macro,
+        and sort the options before printing. Reorder some code so that features still get
+        propagated to the bindings generators.
+
+2015-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>
+
         [CMake] Options should be marked as advanced by default
         https://bugs.webkit.org/show_bug.cgi?id=143572
 
index c18f81b..6ea8272 100644 (file)
@@ -168,13 +168,7 @@ macro(WEBKIT_OPTION_BEGIN)
 endmacro()
 
 macro(WEBKIT_OPTION_END)
-    foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS})
-        option(${_name} "${_WEBKIT_AVAILABLE_OPTIONS_DESCRIPTION_${_name}}" ${_WEBKIT_AVAILABLE_OPTIONS_INITIALVALUE_${_name}})
-        if (NOT _WEBKIT_AVAILABLE_OPTIONS_ISPUBLIC_${_name})
-            mark_as_advanced(FORCE ${_name})
-        endif ()
-    endforeach ()
-
+    list(SORT _WEBKIT_AVAILABLE_OPTIONS)
     set(_MAX_FEATURE_LENGTH 0)
     foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS})
         string(LENGTH ${_name} _NAME_LENGTH)
@@ -188,8 +182,20 @@ macro(WEBKIT_OPTION_END)
                 set(${_name} OFF)
             endif ()
         endif ()
+
+        option(${_name} "${_WEBKIT_AVAILABLE_OPTIONS_DESCRIPTION_${_name}}" ${_WEBKIT_AVAILABLE_OPTIONS_INITIALVALUE_${_name}})
+        if (NOT _WEBKIT_AVAILABLE_OPTIONS_ISPUBLIC_${_name})
+            mark_as_advanced(FORCE ${_name})
+        endif ()
+
+        if (${_name})
+            list(APPEND FEATURE_DEFINES ${_name})
+            set(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR} ${_name}")
+        endif ()
     endforeach ()
+endmacro()
 
+macro(PRINT_WEBKIT_OPTIONS)
     message(STATUS "Enabled features:")
 
     set(_SHOULD_PRINT_POINTS OFF)
@@ -210,11 +216,6 @@ macro(WEBKIT_OPTION_END)
             set(_SHOULD_PRINT_POINTS ON)
         endif ()
 
-        if (${_name})
-            list(APPEND FEATURE_DEFINES ${_name})
-            set(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR} ${_name}")
-        endif ()
-
         set(_MESSAGE "${_MESSAGE} ${${_name}}")
 
         if (_WEBKIT_AVAILABLE_OPTIONS_ISPUBLIC_${_name})