Title: [289819] trunk
Revision
289819
Author
[email protected]
Date
2022-02-15 10:23:35 -0800 (Tue, 15 Feb 2022)

Log Message

[CMake] Checks uses of execute_process() for correct command splitting
https://bugs.webkit.org/show_bug.cgi?id=236366

Reviewed by Don Olmstead.

.:

* Source/cmake/FindGObjectIntrospection.cmake: Remove macro _GIR_GET_PKGCONFIG_VAR, which used
execute_process(), in favor of pkg_get_variable(), which has been supported since CMake 3.4

Source/_javascript_Core:

* CMakeLists.txt: string(TIMESTAMP var "%s") has been supported since CMake 3.6, and given
that 3.12 is required we can use it instead of shelling out to run the "date" program.

Modified Paths

Diff

Modified: trunk/ChangeLog (289818 => 289819)


--- trunk/ChangeLog	2022-02-15 18:05:44 UTC (rev 289818)
+++ trunk/ChangeLog	2022-02-15 18:23:35 UTC (rev 289819)
@@ -1,3 +1,13 @@
+2022-02-15  Adrian Perez de Castro  <[email protected]>
+
+        [CMake] Checks uses of execute_process() for correct command splitting
+        https://bugs.webkit.org/show_bug.cgi?id=236366
+
+        Reviewed by Don Olmstead.
+
+        * Source/cmake/FindGObjectIntrospection.cmake: Remove macro _GIR_GET_PKGCONFIG_VAR, which used
+        execute_process(), in favor of pkg_get_variable(), which has been supported since CMake 3.4
+
 2022-02-11  Don Olmstead  <[email protected]>
 
         [CMake] Check for MAP_ALIGNED support

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (289818 => 289819)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2022-02-15 18:05:44 UTC (rev 289818)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2022-02-15 18:23:35 UTC (rev 289819)
@@ -249,13 +249,8 @@
     VERBATIM)
 add_custom_target(Bytecodes DEPENDS "${_javascript_Core_DERIVED_SOURCES_DIR}/Bytecodes.h")
 
+string(TIMESTAMP BUILD_TIME "%s")
 
-if (WTF_OS_MAC_OS_X)
-    execute_process(COMMAND bash -c "date +'%s'" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
-else ()
-    string(TIMESTAMP BUILD_TIME "%s")
-endif ()
-
 list(APPEND _javascript_Core_HEADERS
     ${_javascript_Core_DERIVED_SOURCES_DIR}/BytecodeStructs.h
     ${_javascript_Core_DERIVED_SOURCES_DIR}/Bytecodes.h

Modified: trunk/Source/_javascript_Core/ChangeLog (289818 => 289819)


--- trunk/Source/_javascript_Core/ChangeLog	2022-02-15 18:05:44 UTC (rev 289818)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-02-15 18:23:35 UTC (rev 289819)
@@ -1,3 +1,13 @@
+2022-02-15  Adrian Perez de Castro  <[email protected]>
+
+        [CMake] Checks uses of execute_process() for correct command splitting
+        https://bugs.webkit.org/show_bug.cgi?id=236366
+
+        Reviewed by Don Olmstead.
+
+        * CMakeLists.txt: string(TIMESTAMP var "%s") has been supported since CMake 3.6, and given
+        that 3.12 is required we can use it instead of shelling out to run the "date" program.
+
 2022-02-14  Yusuke Suzuki  <[email protected]>
 
         `Array#{ groupBy, groupByToMap }` should throw a `TypeError` when `this` is `null` or `undefined`

Modified: trunk/Source/cmake/FindGObjectIntrospection.cmake (289818 => 289819)


--- trunk/Source/cmake/FindGObjectIntrospection.cmake	2022-02-15 18:05:44 UTC (rev 289818)
+++ trunk/Source/cmake/FindGObjectIntrospection.cmake	2022-02-15 18:23:35 UTC (rev 289819)
@@ -15,21 +15,7 @@
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 
-macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname _extra_args)
-    execute_process(
-        COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} ${_extra_args} gobject-introspection-1.0
-        OUTPUT_VARIABLE _result
-        RESULT_VARIABLE _null
-    )
 
-    if (_null)
-    else ()
-        string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
-        string(REGEX REPLACE " +$" ""  _result "${_result}")
-        separate_arguments(_result)
-        set(${_outvar} ${_result} CACHE INTERNAL "")
-    endif ()
-endmacro(_GIR_GET_PKGCONFIG_VAR)
 
 find_package(PkgConfig QUIET)
 if (PKG_CONFIG_FOUND)
@@ -39,11 +25,11 @@
     pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp})
     if (_pc_gir_FOUND)
         set(INTROSPECTION_FOUND TRUE)
-        _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner" "")
-        _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler" "")
-        _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate" "")
-        _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir" "")
-        _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir" "")
+        pkg_get_variable(INTROSPECTION_SCANNER gobject-introspection-1.0 g_ir_scanner)
+        pkg_get_variable(INTROSPECTION_COMPILER gobject-introspection-1.0 g_ir_compiler)
+        pkg_get_variable(INTROSPECTION_GENERATE gobject-introspection-1.0 g_ir_generate)
+        pkg_get_variable(INTROSPECTION_GIRDIR gobject-introspection-1.0 girdir)
+        pkg_get_variable(INTROSPECTION_TYPELIBDIR gobject-introspection-1.0 typelibdir)
         set(INTROSPECTION_VERSION "${_pc_gir_VERSION}")
         if (${INTROSPECTION_VERSION} VERSION_GREATER_EQUAL "1.59.1")
             set(INTROSPECTION_HAVE_SOURCES_TOP_DIRS YES)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to