Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression(278398@main): COG does not build for the first time with meson before 1.1.0 #28470

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Tools/PlatformWPE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ endif ()

if (ENABLE_COG)
include(ExternalProject)
find_program(MESON_EXE NAMES meson)
execute_process(
COMMAND "${MESON_EXE}" --version
OUTPUT_VARIABLE MESON_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
ERROR_QUIET
)
if ("${MESON_VERSION}" VERSION_GREATER 1.1.0)
set(MESON_RECONFIGURE flag)
else ()
set(MESON_RECONFIGURE remove)
endif ()

if ("${WPE_COG_PLATFORMS}" STREQUAL "")
set(WPE_COG_PLATFORMS "drm,headless,gtk4,x11,wayland")
elseif ("${WPE_COG_PLATFORMS}" STREQUAL "none")
Expand Down Expand Up @@ -63,7 +77,9 @@ if (ENABLE_COG)
SOURCE_DIR "${CMAKE_SOURCE_DIR}/Tools/wpe/cog"
BUILD_IN_SOURCE FALSE
CONFIGURE_COMMAND
meson setup --reconfigure <BINARY_DIR> <SOURCE_DIR>
${CMAKE_SOURCE_DIR}/Tools/wpe/meson-wrapper
${MESON_RECONFIGURE}
<BINARY_DIR> <SOURCE_DIR>
--buildtype ${COG_MESON_BUILDTYPE}
--pkg-config-path ${WPE_COG_PKG_CONFIG_PATH}
-Dwpe_api=${WPE_API_VERSION}
Expand All @@ -73,4 +89,8 @@ if (ENABLE_COG)
meson compile -C <BINARY_DIR>
INSTALL_COMMAND "")
ExternalProject_Add_StepDependencies(cog build WebKit)
ExternalProject_Add_StepDependencies(cog configure
"${CMAKE_BINARY_DIR}/cmakeconfig.h"
"${WPE_PKGCONFIG_FILE}"
)
endif ()
14 changes: 14 additions & 0 deletions Tools/wpe/meson-wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env sh
set -e

reconfigure_mode=$1
shift

if [ "$reconfigure_mode" = flag ] || [ -r "$1/build.ninja" ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this statement variable $1 can be replaced for $reconfigure_mode.

Copy link
Contributor Author

@pgorszkowski-igalia pgorszkowski-igalia May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reconfigure_mode holds what was in $1, after 'shift' $1 has actually the second parameter which was passed to meson-wrapper (<BINARY_DIR>)

set -- setup --reconfigure "$@"
else
set -- setup "$@"
fi

echo "MESON: meson $*"
exec meson "$@"