$NetBSD: patch-src_core_CMakeLists.txt,v 1.1 2025/12/21 09:38:51 markd Exp $

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

--- src/core/CMakeLists.txt.orig	2025-11-14 07:55:10.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()
 
@@ -212,7 +212,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
@@ -220,17 +220,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
         )
@@ -342,6 +342,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
@@ -461,7 +462,7 @@ foreach(arch ${archs})
             CONDITION QT_FEATURE_webenginedriver
         )
 
-        if(LINUX)
+        if(UNIX)
             list(APPEND gnArgArg
                 angle_enable_gl=true
                 use_gtk=false # GTK toolkit bindings
@@ -530,6 +531,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
             )
