diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index bcf5d16..96c9524 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -2,35 +2,35 @@ name: Windows CI on: workflow_dispatch: - # push: - # branches: - # - main - # tags: - # - '**' - # paths-ignore: - # - ".gitignore" - # - "README.md" - # # ignore CI for other platforms - # - ".github/FUNDING.yml" - # - ".github/actions/**" - # - ".github/workflows/Android.yml" - # - ".github/workflows/iOS.yml" - # - ".github/workflows/Linux.yml" - # - ".github/workflows/macOS.yml" - - # pull_request: - # branches: - # - main - # paths-ignore: - # - ".gitignore" - # - "README.md" - # # ignore CI for other platforms - # - ".github/FUNDING.yml" - # - ".github/actions/**" - # - ".github/workflows/Android.yml" - # - ".github/workflows/iOS.yml" - # - ".github/workflows/Linux.yml" - # - ".github/workflows/macOS.yml" + push: + branches: + - main + tags: + - "**" + paths-ignore: + - ".gitignore" + - "README.md" + # ignore CI for other platforms + - ".github/FUNDING.yml" + - ".github/actions/**" + - ".github/workflows/Android.yml" + - ".github/workflows/iOS.yml" + - ".github/workflows/Linux.yml" + - ".github/workflows/macOS.yml" + + pull_request: + branches: + - main + paths-ignore: + - ".gitignore" + - "README.md" + # ignore CI for other platforms + - ".github/FUNDING.yml" + - ".github/actions/**" + - ".github/workflows/Android.yml" + - ".github/workflows/iOS.yml" + - ".github/workflows/Linux.yml" + - ".github/workflows/macOS.yml" concurrency: # cancel jobs on PRs only @@ -38,26 +38,36 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} env: - QT_VERSION: 6.5.0 CCACHE_CONFIGPATH: C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf jobs: - build-plugin: - name: Build QMapLibre for ${{ matrix.config.qtarch }} + build-and-test: + name: Build QMapLibre for Windows (Qt${{ matrix.qt_version}}, ${{ matrix.arch }}) runs-on: windows-2022 strategy: matrix: - config: - - arch: win64_msvc2019_64 - qtarch: msvc2019_64 + include: + - qt_series: 5 + qt_version: 5.15.2 + qt_arch: win64_msvc2019_64 + qt_modules: "" + arch: msvc2019_64 + compiler: x64 + compiler_version: 14.29 + - qt_series: 6 + qt_version: 6.5.3 + qt_arch: win64_msvc2019_64 + qt_modules: qtlocation qtpositioning + arch: msvc2019_64 + compiler: x64 + compiler_version: 14.29 + - qt_series: 6 + qt_version: 6.6.0 + qt_arch: win64_msvc2019_64 + qt_modules: qtlocation qtpositioning + arch: msvc2019_64 compiler: x64 compiler_version: 14.29 - tools: "" - - arch: win64_mingw - qtarch: mingw_64 - compiler: mingw1120_64 - compiler_version: 11.2.0 - tools: tools_mingw90 steps: - name: Checkout @@ -78,21 +88,20 @@ jobs: uses: jurplel/install-qt-action@v3 with: aqtversion: ==3.1.* - version: ${{ env.QT_VERSION }} + version: ${{ matrix.qt_version }} target: desktop - arch: ${{ matrix.config.arch }} - modules: qtlocation qtpositioning - tools: ${{ matrix.config.tools }} + arch: ${{ matrix.arch }} + modules: ${{ matrix.qt_modules }} - name: Setup ninja uses: seanmiddleditch/gha-setup-ninja@v4 - name: Setup MSVC - if: matrix.config.arch == 'win64_msvc2019_64' + if: matrix.qt_arch == 'win64_msvc2019_64' uses: ilammy/msvc-dev-cmd@v1 with: - arch: ${{ matrix.config.compiler }} - toolset: ${{ matrix.config.compiler_version }} + arch: ${{ matrix.compiler }} + toolset: ${{ matrix.compiler_version }} - name: Update ccache run: | @@ -102,74 +111,116 @@ jobs: - name: Set up ccache uses: hendrikmuhs/ccache-action@v1 with: - key: Windows_QMapLibre_${{ matrix.config.qtarch }} + key: Windows_QMapLibre_${{ matrix.qt_version }}_${{ matrix.arch }} max-size: 200M - name: Build QMapLibre shell: bash env: - COMPILER_TYPE: ${{ matrix.config.compiler }} + COMPILER_TYPE: ${{ matrix.compiler }} run: | - export PATH=$IQTA_TOOLS/$COMPILER_TYPE/bin:$PATH - echo "$PATH" mkdir build && cd build qt-cmake.bat ../source/ \ -G"Ninja Multi-Config" \ -DCMAKE_CONFIGURATION_TYPES="Release;Debug" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ - -DQT_USE_CCACHE=ON + -DCMAKE_INSTALL_PREFIX="../install" \ ninja.exe - DESTDIR=../install ninja.exe install + ninja.exe test + ninja.exe install + + - name: Build QtQuick Example (Qt 6) + if: matrix.qt_series == 6 + run: | + export PREFIX_PATH="$(pwd)/install" + mkdir build-example-quick && cd build-example-quick + qt-cmake ../source/examples/quick/ \ + -G Ninja \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ + -DCMAKE_PREFIX_PATH="$PREFIX_PATH" + ninja + ninja deploy + + - name: Build QtWidgets Example (Qt 6) + if: matrix.qt_series == 6 + run: | + export PREFIX_PATH="$(pwd)/install" + mkdir build-example-widgets && cd build-example-widgets + qt-cmake ../source/examples/widgets/ \ + -G Ninja \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ + -DCMAKE_PREFIX_PATH="$PREFIX_PATH" + ninja + ninja deploy - - name: Create artifacts + - name: Compress installation shell: bash env: - TAG_ARCH: ${{ matrix.config.qtarch }} + TAG_ARCH: ${{ matrix.arch }} run: | - pushd install/a/maplibre-native-qt - tar cjvf ../../../QMapLibre_Windows_${TAG_ARCH}.tar.bz2 Qt + pushd install + tar cjvf ../QMapLibre_Windows_${TAG_ARCH}.tar.bz2 * popd - - name: Upload artifacts + - name: Compress examples + if: matrix.qt_series == 6 + shell: bash + env: + TAG_ARCH: ${{ matrix.arch }} + run: | + mkdir examples && pushd examples + cp -a ../build-example-quick/QMapLibreExampleQuick.exe . + cp -a ../build-example-widgets/QMapLibreExampleWidgets.exe . + tar cjvf ../QMapLibre_Windows_${TAG_ARCH}_examples.tar.bz2 * + popd + + - name: Upload installation + uses: actions/upload-artifact@v4 + with: + name: QMapLibre_Windows_${{ matrix.arch }}_${{ matrix.qt_version }} + path: QMapLibre_Windows_${{ matrix.arch }}.tar.bz2 + + - name: Upload examples + if: matrix.qt_series == 6 uses: actions/upload-artifact@v4 with: - name: QMapLibre_Windows_${{ matrix.config.qtarch }} - path: QMapLibre_Windows_${{ matrix.config.qtarch }}.tar.bz2 + name: QMapLibre_Windows_${{ matrix.arch }}_${{ matrix.qt_version }}_examples + path: QMapLibre_Windows_${{ matrix.arch }}_examples.tar.bz2 release: name: Release QMapLibre if: github.ref_type == 'tag' runs-on: windows-2022 - needs: build-plugin - strategy: - matrix: - config: - - qtarch: msvc2019_64 - outarch: msvc2019 - - qtarch: mingw_64 - outarch: mingw + needs: build-and-test permissions: contents: write + strategy: + matrix: + qt_version: [5.15.2, 6.5.3, 6.6.0] + arch: [msvc2019_64] steps: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: QMapLibre_Windows_${{ matrix.config.qtarch }} + name: QMapLibre_Windows_${{ matrix.arch }}_${{ matrix.qt_version }}} - name: Make tarball shell: bash env: TAG_NAME: ${{ github.ref_name }} - QT_ARCH: ${{ matrix.config.qtarch }} - TAG_ARCH: ${{ matrix.config.outarch }} + TAG_ARCH: ${{ matrix.arch }} run: | - mv QMapLibre_Windows_${QT_ARCH}.tar.bz2 QMapLibre_${TAG_NAME}_Qt${QT_VERSION}_win64_${TAG_ARCH}.tar.bz2 + mv QMapLibre_Windows_${TAG_ARCH}.tar.bz2 QMapLibre_${TAG_NAME}_Qt${QT_VERSION}_${TAG_ARCH}.tar.bz2 - name: Release uses: ncipollo/release-action@v1 with: - artifacts: QMapLibre_${{ github.ref_name }}_Qt${{ env.QT_VERSION }}_win64_${{ matrix.config.outarch }}.tar.bz2 + artifacts: QMapLibre_${{ github.ref_name }}_Qt${{ matrix.qt_version }}_win64_${{ matrix.arch }}.tar.bz2 allowUpdates: true draft: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 396e917..5b984ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if(MSVC) foreach(lang C CXX) set(flags_var "CMAKE_${lang}_FLAGS_${config}") string(REPLACE "/Zi" "/Z7" ${flags_var} "${${flags_var}}") - set(${flags_var} "${${flags_var}}" PARENT_SCOPE) + set(${flags_var} "${${flags_var}}") endforeach() endforeach() endif() diff --git a/src/core/style/style_change_p.hpp b/src/core/style/style_change_p.hpp index 08c2363..198b4d0 100644 --- a/src/core/style/style_change_p.hpp +++ b/src/core/style/style_change_p.hpp @@ -19,6 +19,11 @@ class Map; class Q_MAPLIBRE_CORE_EXPORT StyleChange { public: + StyleChange() = default; + StyleChange(const StyleChange &s) = delete; + StyleChange(StyleChange &&s) noexcept = default; + StyleChange &operator=(const StyleChange &s) = delete; + StyleChange &operator=(StyleChange &&s) noexcept = default; virtual ~StyleChange() = default; [[nodiscard]] bool isValid() const { return m_valid; } diff --git a/src/location/plugins/CMakeLists.txt b/src/location/plugins/CMakeLists.txt index 71f0bf9..eab5b1a 100644 --- a/src/location/plugins/CMakeLists.txt +++ b/src/location/plugins/CMakeLists.txt @@ -22,7 +22,7 @@ set_target_properties( PROPERTIES AUTOMOC ON EXPORT_NAME PluginGeoServices - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/geoservices" + LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_CURRENT_BINARY_DIR}/geoservices> ) # QtLocation plugin include directories @@ -87,6 +87,11 @@ if(COMMAND qt_add_qml_module) OUTPUT_TARGETS QmlPluginOutputTargets SOURCES ${Plugin_Sources} ) + set_target_properties( + ${MLN_QT_QML_PLUGIN} + PROPERTIES + LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_CURRENT_BINARY_DIR}/QtLocation/MapLibre> + ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/qmldir.in" "${CMAKE_CURRENT_BINARY_DIR}/QtLocation/MapLibre/qmldir" @@ -114,7 +119,7 @@ else() ${MLN_QT_QML_PLUGIN} PROPERTIES AUTOMOC ON - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/QtLocation/MapLibre" + LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_CURRENT_BINARY_DIR}/QtLocation/MapLibre> ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/legacy/qmldir.in" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 310b920..dde1451 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,6 +6,11 @@ if( return() endif() +if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_VERSION VERSION_LESS "3.22.0") + message(STATUS "Tests on Windows require CMake 3.22 or later and will be disabled") + return() +endif() + add_subdirectory(core) if(MLN_QT_WITH_LOCATION) add_subdirectory(qml) diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 958d1d4..883eec3 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -45,3 +45,9 @@ set_tests_properties( PROPERTIES ENVIRONMENT "MLN_FIXTURES_PATH=${CMAKE_SOURCE_DIR}/vendor/maplibre-native/test/fixtures" ) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set_tests_properties( + test_mln_core + PROPERTIES + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") +endif() diff --git a/test/qml/CMakeLists.txt b/test/qml/CMakeLists.txt index 5f56983..5dd920b 100644 --- a/test/qml/CMakeLists.txt +++ b/test/qml/CMakeLists.txt @@ -23,5 +23,11 @@ add_test( set_tests_properties( test_mln_qml PROPERTIES - ENVIRONMENT "DYLD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/core:${CMAKE_BINARY_DIR}/src/location;QSG_RHI_BACKEND=opengl;QML_IMPORT_PATH=${CMAKE_BINARY_DIR}/src/location/plugins;QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/src/location/plugins;QT_PLUGIN_PATH=${CMAKE_BINARY_DIR}/src/location/plugins" + ENVIRONMENT "$<$:DYLD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/core:${CMAKE_BINARY_DIR}/src/location;>QSG_RHI_BACKEND=opengl;QML_IMPORT_PATH=${CMAKE_BINARY_DIR}/src/location/plugins;QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/src/location/plugins;QT_PLUGIN_PATH=${CMAKE_BINARY_DIR}/src/location/plugins" ) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set_tests_properties( + test_mln_qml + PROPERTIES + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$") +endif() diff --git a/test/widgets/CMakeLists.txt b/test/widgets/CMakeLists.txt index 961e9ed..15681e6 100644 --- a/test/widgets/CMakeLists.txt +++ b/test/widgets/CMakeLists.txt @@ -37,3 +37,9 @@ add_test( NAME test_mln_widgets COMMAND $ ) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set_tests_properties( + test_mln_widgets + PROPERTIES + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$") +endif()