$NetBSD: patch-src_core_CMakeLists.txt,v 1.2 2026/05/13 05:31:25 adam Exp $

* Based on OpenBSD's qt6-qtwebengine patches, and
  pkgsrc's qt5-qtwebengine patches
  - add sndio
  - add audioio

--- src/core/CMakeLists.txt.orig	2026-05-08 07:54:08.000000000 +0000
+++ src/core/CMakeLists.txt
@@ -21,7 +21,7 @@ add_subdirectory(tools/qwebengine_conver
 #   TOOLCHAIN SETUP
 ##
 
-if(LINUX OR WIN32)
+if(UNIX OR WIN32)
     setup_toolchains()
 endif()
 
@@ -216,7 +216,7 @@ foreach(arch ${archs})
                 accessibility_activation_observer.cpp accessibility_activation_observer.h
         )
 
-        extend_gn_target(${buildGn} CONDITION LINUX
+        extend_gn_target(${buildGn} CONDITION UNIX
             SOURCES
                 ozone/gl_ozone_qt.cpp ozone/gl_ozone_qt.h
                 ozone/ozone_util_qt.cpp ozone/ozone_util_qt.h
@@ -224,17 +224,17 @@ foreach(arch ${archs})
                 ozone/surface_factory_qt.cpp ozone/surface_factory_qt.h
         )
 
-        extend_gn_target(${buildGn} CONDITION LINUX AND QT_FEATURE_opengl
+        extend_gn_target(${buildGn} CONDITION UNIX AND QT_FEATURE_opengl
             SOURCES
                 ozone/gl_helper.cpp ozone/gl_helper.h
         )
 
-        extend_gn_target(${buildGn} CONDITION LINUX AND QT_FEATURE_opengl AND QT_FEATURE_webengine_ozone_x11 AND QT_FEATURE_xcb_glx_plugin
+        extend_gn_target(${buildGn} CONDITION UNIX AND QT_FEATURE_opengl AND QT_FEATURE_webengine_ozone_x11 AND QT_FEATURE_xcb_glx_plugin
             SOURCES
                 ozone/glx_helper.cpp ozone/glx_helper.h
         )
 
-        extend_gn_target(${buildGn} CONDITION LINUX AND QT_FEATURE_opengl AND QT_FEATURE_egl
+        extend_gn_target(${buildGn} CONDITION UNIX AND QT_FEATURE_opengl AND QT_FEATURE_egl
             SOURCES
                 ozone/egl_helper.cpp ozone/egl_helper.h
         )
@@ -345,6 +345,8 @@ foreach(arch ${archs})
         append_pkg_config_setup(gnArgArg)
 
         list(APPEND gnArgArg
+            extra_cxxflags="@EXTRA_CXXFLAGS@"
+            use_system_libdrm=true
             qtwebengine_target="${buildDir}/${config}/${arch}:QtWebEngineCore"
             build_dawn_tests=false
             build_with_tflite_lib=false
@@ -452,7 +454,7 @@ foreach(arch ${archs})
             CONDITION QT_FEATURE_webenginedriver
         )
 
-        if(LINUX)
+        if(UNIX)
             list(APPEND gnArgArg
                 use_gtk=false # GTK toolkit bindings
                 use_qt5=false # Qt5 toolkit bindings
@@ -524,6 +526,14 @@ foreach(arch ${archs})
                 CONDITION QT_FEATURE_webengine_system_pulseaudio
             )
             extend_gn_list(gnArgArg
+                ARGS use_sndio
+                CONDITION QT_FEATURE_webengine_system_sndio
+            )
+            extend_gn_list(gnArgArg
+                ARGS use_audioio
+                CONDITION QT_FEATURE_webengine_system_audioio
+            )
+            extend_gn_list(gnArgArg
                 ARGS use_system_minigbm
                 CONDITION QT_FEATURE_webengine_system_gbm
             )
