Enhance CI configuration and CMake support for native file dialog

- Updated CI workflow in ci.yml to include the -Wno-dev flag for improved CMake output during configuration.
- Modified CMakeLists.txt to conditionally add native file dialog support based on platform checks and GTK3 availability, enhancing compatibility and providing clearer status messages for NFD support.
This commit is contained in:
scawful
2025-09-25 10:43:39 -04:00
parent fd49fb8511
commit 4f5250f5ca
2 changed files with 23 additions and 3 deletions

View File

@@ -165,13 +165,14 @@ jobs:
-DYAZE_MINIMAL_BUILD=ON \ -DYAZE_MINIMAL_BUILD=ON \
-DYAZE_ENABLE_ROM_TESTS=OFF \ -DYAZE_ENABLE_ROM_TESTS=OFF \
-DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF \ -DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF \
-Wno-dev \
-GNinja -GNinja
- name: Configure CMake (Windows) - name: Configure CMake (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: cmd shell: cmd
run: | run: |
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -DYAZE_MINIMAL_BUILD=ON -DYAZE_ENABLE_ROM_TESTS=OFF -DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF -G "${{ matrix.cmake_generator }}" -A ${{ matrix.cmake_generator_platform }} cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -DYAZE_MINIMAL_BUILD=ON -DYAZE_ENABLE_ROM_TESTS=OFF -DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF -Wno-dev -G "${{ matrix.cmake_generator }}" -A ${{ matrix.cmake_generator_platform }}
# Build # Build
- name: Build - name: Build

View File

@@ -43,10 +43,29 @@ endforeach()
# Conditionally add native file dialog (optional for CI builds) # Conditionally add native file dialog (optional for CI builds)
if(NOT YAZE_MINIMAL_BUILD) if(NOT YAZE_MINIMAL_BUILD)
add_subdirectory(lib/nativefiledialog-extended) # Check if we can build NFD before adding it
set(YAZE_HAS_NFD ON) find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND AND UNIX AND NOT APPLE)
pkg_check_modules(GTK3 QUIET gtk+-3.0)
if(GTK3_FOUND)
add_subdirectory(lib/nativefiledialog-extended)
set(YAZE_HAS_NFD ON)
message(STATUS "NFD enabled with GTK3 support")
else()
set(YAZE_HAS_NFD OFF)
message(STATUS "NFD disabled - GTK3 not found")
endif()
elseif(WIN32 OR APPLE)
add_subdirectory(lib/nativefiledialog-extended)
set(YAZE_HAS_NFD ON)
message(STATUS "NFD enabled for Windows/macOS")
else()
set(YAZE_HAS_NFD OFF)
message(STATUS "NFD disabled - no platform support")
endif()
else() else()
set(YAZE_HAS_NFD OFF) set(YAZE_HAS_NFD OFF)
message(STATUS "NFD disabled for minimal build")
endif() endif()
if (YAZE_BUILD_APP) if (YAZE_BUILD_APP)