LibWebView: Enable in Windows CI

This commit is contained in:
ayeteadoe
2025-06-26 01:35:37 -07:00
committed by Andrew Kaster
parent 09ff99c50e
commit ee3c033de2
Notes: github-actions[bot] 2025-08-23 22:07:48 +00:00
9 changed files with 26 additions and 11 deletions

View File

@@ -119,6 +119,12 @@ runs:
brew update brew update
brew install autoconf autoconf-archive automake bash ccache coreutils llvm@20 nasm ninja pkg-config qt unzip wabt brew install autoconf autoconf-archive automake bash ccache coreutils llvm@20 nasm ninja pkg-config qt unzip wabt
- name: Install Qt (Windows)
if: ${{ inputs.os == 'Windows' }}
uses: jurplel/install-qt-action@v4
with:
modules: "qtmultimedia"
- name: 'Set required environment variables' - name: 'Set required environment variables'
if: ${{ inputs.os == 'Linux' && inputs.arch == 'arm64' }} if: ${{ inputs.os == 'Linux' && inputs.arch == 'arm64' }}
uses: actions/github-script@v7 uses: actions/github-script@v7

View File

@@ -12,9 +12,6 @@
#ifdef AK_OS_WINDOWS #ifdef AK_OS_WINDOWS
// Forward declare to avoid pulling Windows.h into every file in existence. // Forward declare to avoid pulling Windows.h into every file in existence.
extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long); extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long);
# ifndef sched_yield
# define sched_yield() Sleep(0)
# endif
#else #else
# include <sched.h> # include <sched.h>
#endif #endif
@@ -57,7 +54,11 @@ public:
} }
// Someone else was faster, wait until they're done // Someone else was faster, wait until they're done
while (obj == (T*)0x1) { while (obj == (T*)0x1) {
#if defined(AK_OS_WINDOWS)
Sleep(0);
#else
sched_yield(); sched_yield();
#endif
obj = obj_var.load(AK::memory_order_acquire); obj = obj_var.load(AK::memory_order_acquire);
} }
if constexpr (allow_create) { if constexpr (allow_create) {

View File

@@ -62,7 +62,7 @@ if (ANDROID AND ENABLE_QT)
set(ENABLE_QT OFF CACHE BOOL "" FORCE) set(ENABLE_QT OFF CACHE BOOL "" FORCE)
endif() endif()
if (ENABLE_QT AND ENABLE_GUI_TARGETS AND (NOT WIN32 OR NOT ENABLE_WINDOWS_CI)) if (ENABLE_QT AND ENABLE_GUI_TARGETS)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
@@ -74,7 +74,7 @@ find_package(OpenSSL REQUIRED)
include(CTest) # for BUILD_TESTING option, default ON include(CTest) # for BUILD_TESTING option, default ON
if (ENABLE_GUI_TARGETS AND (NOT WIN32 OR NOT ENABLE_WINDOWS_CI)) if (ENABLE_GUI_TARGETS)
add_subdirectory(Services) add_subdirectory(Services)
add_subdirectory(UI) add_subdirectory(UI)
endif() endif()

View File

@@ -145,8 +145,7 @@
"displayName": "Windows CI Config", "displayName": "Windows CI Config",
"description": "CI Windows build", "description": "CI Windows build",
"cacheVariables": { "cacheVariables": {
"ENABLE_WINDOWS_CI": "ON", "ENABLE_WINDOWS_CI": "ON"
"ENABLE_QT": "OFF"
} }
}, },
{ {

View File

@@ -24,6 +24,7 @@ if (ENABLE_GUI_TARGETS)
add_subdirectory(LibImageDecoderClient) add_subdirectory(LibImageDecoderClient)
add_subdirectory(LibMedia) add_subdirectory(LibMedia)
add_subdirectory(LibWeb) add_subdirectory(LibWeb)
add_subdirectory(LibWebView)
endif() endif()
# FIXME: Increase support for building targets on Windows # FIXME: Increase support for building targets on Windows
@@ -36,5 +37,4 @@ add_subdirectory(LibLine)
if (ENABLE_GUI_TARGETS) if (ENABLE_GUI_TARGETS)
# FIXME: TCPServer still needs to be implemented on Windows # FIXME: TCPServer still needs to be implemented on Windows
add_subdirectory(LibDevTools) add_subdirectory(LibDevTools)
add_subdirectory(LibWebView)
endif() endif()

View File

@@ -10,6 +10,7 @@
#include <AK/Utf16FlyString.h> #include <AK/Utf16FlyString.h>
#include <AK/Utf16String.h> #include <AK/Utf16String.h>
#include <AK/Variant.h> #include <AK/Variant.h>
#include <LibJS/Export.h>
namespace JS { namespace JS {
@@ -175,7 +176,7 @@ enum class TokenCategory {
Identifier Identifier
}; };
class Token { class JS_API Token {
public: public:
Token() = default; Token() = default;

View File

@@ -93,6 +93,10 @@ if (ENABLE_QT)
set_target_properties(LibWebViewQt PROPERTIES AUTOMOC ON AUTORCC OFF AUTOUIC OFF) set_target_properties(LibWebViewQt PROPERTIES AUTOMOC ON AUTORCC OFF AUTOUIC OFF)
find_package(Qt6 REQUIRED COMPONENTS Core) find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(LibWebViewQt PUBLIC Qt::Core) target_link_libraries(LibWebViewQt PUBLIC Qt::Core)
if (WIN32)
find_package(pthread REQUIRED)
target_include_directories(LibWebViewQt PRIVATE $<BUILD_INTERFACE:${PTHREAD_INCLUDE_DIR}>)
endif()
target_link_libraries(LibWebViewPlatform INTERFACE LibWebViewQt) target_link_libraries(LibWebViewPlatform INTERFACE LibWebViewQt)
elseif (APPLE) elseif (APPLE)
add_library(LibWebViewCocoa STATIC add_library(LibWebViewCocoa STATIC

View File

@@ -42,7 +42,7 @@ public:
private: private:
Core::Platform::ProcessStatistics m_statistics; Core::Platform::ProcessStatistics m_statistics;
HashMap<pid_t, Process> m_processes; HashMap<pid_t, Process> m_processes;
int m_signal_handle { -1 }; [[maybe_unused]] int m_signal_handle { -1 };
Threading::Mutex m_lock; Threading::Mutex m_lock;
}; };

View File

@@ -5,7 +5,11 @@ function(lagom_generate_export_header name fs_name)
# to export symbols required by external consumers. This allows the codebase # to export symbols required by external consumers. This allows the codebase
# to gradually slowly migrate instead of an all-or-nothing approach. # to gradually slowly migrate instead of an all-or-nothing approach.
if (NOT WIN32) if (NOT WIN32)
add_cxx_compile_options(${name} PRIVATE -fvisibility=hidden) target_compile_options(${name}
PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:-fvisibility=hidden>"
"$<$<COMPILE_LANGUAGE:C>:-fvisibility=hidden>"
)
else() else()
set_target_properties(${name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS OFF) set_target_properties(${name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS OFF)
endif() endif()