[CMake] Print sorted feature list at the very end of the configure process
[WebKit-https.git] / Source / cmake / WebKitFeatures.cmake
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})