diff --git a/.cmake-format.json b/.cmake-format.json index b70e8c5..31bd607 100644 --- a/.cmake-format.json +++ b/.cmake-format.json @@ -6,15 +6,6 @@ "autosort": true }, "additional_commands": { - "find_qt": { - "flags": [], - "kwargs": { - "COMPONENTS": "+", - "COMPONENTS_WIN": "+", - "COMPONENTS_MACOS": "+", - "COMPONENTS_LINUX": "+" - } - }, "set_target_properties_obs": { "pargs": 1, "flags": [], diff --git a/.github/actions/run-clang-format/action.yaml b/.github/actions/run-clang-format/action.yaml index 9e873b4..70ed142 100644 --- a/.github/actions/run-clang-format/action.yaml +++ b/.github/actions/run-clang-format/action.yaml @@ -28,7 +28,7 @@ runs: echo ::group::Install Dependencies eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH - echo "/home/linuxbrew/.linuxbrew/opt/clang-format@16/bin" >> $GITHUB_PATH + echo "/home/linuxbrew/.linuxbrew/opt/clang-format@17/bin" >> $GITHUB_PATH brew install --quiet zsh echo ::endgroup:: @@ -51,11 +51,11 @@ runs: } if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) { - echo ::group::Install clang-format-16 - brew install --quiet obsproject/tools/clang-format@16 + echo ::group::Install clang-format-17 + brew install --quiet obsproject/tools/clang-format@17 echo ::endgroup:: - echo ::group::Run clang-format-16 + echo ::group::Run clang-format-17 ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check echo ::endgroup:: } diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 6425a51..bfcd7d8 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -20,7 +20,7 @@ jobs: commitHash: ${{ steps.setup.outputs.commitHash }} pluginName: ${{ steps.setup.outputs.pluginName }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Check Event Data ☑️ @@ -73,13 +73,13 @@ jobs: macos-build: name: Build for macOS 🍏 - runs-on: macos-13 + runs-on: macos-14 needs: check-event defaults: run: shell: zsh --no-rcs --errexit --pipefail {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -90,6 +90,10 @@ jobs: : Set Up Environment 🔧 if (( ${+RUNNER_DEBUG} )) setopt XTRACE + print '::group::Enable Xcode 15.2' + sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer + print '::endgroup::' + print '::group::Clean Homebrew Environment' local -a to_remove=() @@ -104,7 +108,7 @@ jobs: print "pluginName=${product_name}" >> $GITHUB_OUTPUT print "pluginVersion=${product_version}" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: ccache-cache with: path: ${{ github.workspace }}/.ccache @@ -149,13 +153,13 @@ jobs: codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }} - name: Upload Artifacts 📡 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal.* - name: Upload Debug Symbol Artifacts 🪲 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ needs.check-event.outputs.config == 'Release' }} with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}-dSYMs @@ -169,7 +173,7 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -186,7 +190,7 @@ jobs: echo "pluginName=${product_name}" >> $GITHUB_OUTPUT echo "pluginVersion=${product_version}" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: ccache-cache with: path: ${{ github.workspace }}/.ccache @@ -211,19 +215,19 @@ jobs: config: ${{ needs.check-event.outputs.config }} - name: Upload Source Tarball 🗜️ - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-sources-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-source.* - name: Upload Artifacts 📡 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.* - name: Upload debug symbol artifacts 🪲 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ fromJSON(needs.check-event.outputs.package) }} with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym @@ -237,7 +241,7 @@ jobs: run: shell: pwsh steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -271,7 +275,7 @@ jobs: package: ${{ fromJSON(needs.check-event.outputs.package) }} - name: Upload Artifacts 📡 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64*.* diff --git a/.github/workflows/check-format.yaml b/.github/workflows/check-format.yaml index bbb3aa2..0d77dc6 100644 --- a/.github/workflows/check-format.yaml +++ b/.github/workflows/check-format.yaml @@ -5,7 +5,11 @@ jobs: clang-format: runs-on: ubuntu-22.04 steps: +<<<<<<< HEAD - uses: actions/checkout@v3 +======= + - uses: actions/checkout@v4 +>>>>>>> template-repo/master with: fetch-depth: 0 - name: clang-format check 🐉 @@ -17,7 +21,11 @@ jobs: cmake-format: runs-on: ubuntu-22.04 steps: +<<<<<<< HEAD - uses: actions/checkout@v3 +======= + - uses: actions/checkout@v4 +>>>>>>> template-repo/master with: fetch-depth: 0 - name: cmake-format check 🎛️ diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 58fe69b..af5b530 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -59,7 +59,7 @@ jobs: esac - name: Download Build Artifacts 📥 - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 if: fromJSON(steps.check.outputs.validTag) id: download @@ -106,7 +106,7 @@ jobs: - name: Create Release 🛫 if: fromJSON(steps.check.outputs.validTag) id: create_release - uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b + uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 with: draft: true prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }} diff --git a/CMakeLists.txt b/CMakeLists.txt index b4fde9c..2872a9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,8 @@ if(ENABLE_FRONTEND_API) endif() if(ENABLE_QT) - find_qt(COMPONENTS Widgets Core) - target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets) + find_package(Qt6 COMPONENTS Widgets Core) + target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets) target_compile_options( ${CMAKE_PROJECT_NAME} PRIVATE $<$:-Wno-quoted-include-in-framework-header -Wno-comma>) diff --git a/CMakePresets.json b/CMakePresets.json index 9ffee7a..d33d3e7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -28,7 +28,6 @@ "generator": "Xcode", "warnings": {"dev": true, "deprecated": true}, "cacheVariables": { - "QT_VERSION": "6", "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0", "CODESIGN_IDENTITY": "$penv{CODESIGN_IDENT}", "CODESIGN_TEAM": "$penv{CODESIGN_TEAM}" @@ -59,7 +58,6 @@ "architecture": "x64", "warnings": {"dev": true, "deprecated": true}, "cacheVariables": { - "QT_VERSION": "6", "CMAKE_SYSTEM_VERSION": "10.0.18363.657" } }, @@ -86,7 +84,6 @@ "generator": "Ninja", "warnings": {"dev": true, "deprecated": true}, "cacheVariables": { - "QT_VERSION": "6", "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, @@ -114,7 +111,6 @@ "generator": "Ninja", "warnings": {"dev": true, "deprecated": true}, "cacheVariables": { - "QT_VERSION": "6", "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, diff --git a/build-aux/.run-format.zsh b/build-aux/.run-format.zsh index a99ea91..0258686 100755 --- a/build-aux/.run-format.zsh +++ b/build-aux/.run-format.zsh @@ -29,23 +29,23 @@ invoke_formatter() { case ${1} { clang) - if (( ${+commands[clang-format-16]} )) { - local formatter=clang-format-16 + if (( ${+commands[clang-format-17]} )) { + local formatter=clang-format-17 } elif (( ${+commands[clang-format]} )) { local formatter=clang-format local -a formatter_version=($(clang-format --version)) - if ! is-at-least 16.0.5 ${formatter_version[-1]}; then - log_error "clang-format is not version 16.0.5 or above (found ${formatter_version[-1]}." + if ! is-at-least 17.0.3 ${formatter_version[-1]}; then + log_error "clang-format is not version 17.0.3 or above (found ${formatter_version[-1]}." exit 2 fi - if ! is-at-least ${formatter_version[-1]} 16.0.5; then - log_error "clang-format is more recent than version 16.0.5 (found ${formatter_version[-1]})." + if ! is-at-least ${formatter_version[-1]} 17.0.3; then + log_error "clang-format is more recent than version 17.0.3 (found ${formatter_version[-1]})." exit 2 fi } else { - log_error "No viable clang-format version found (required 16.0.5)" + log_error "No viable clang-format version found (required 17.0.3)" exit 2 } diff --git a/buildspec.json b/buildspec.json index 6a29f1b..06eb54f 100644 --- a/buildspec.json +++ b/buildspec.json @@ -1,33 +1,33 @@ { "dependencies": { "obs-studio": { - "version": "30.0.2", + "version": "30.1.2", "baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags", "label": "OBS sources", "hashes": { - "macos": "be12c3ad0a85713750d8325e4b1db75086223402d7080d0e3c2833d7c5e83c27", - "windows-x64": "970058c49322cfa9cd6d620abb393fed89743ba7e74bd9dbb6ebe0ea8141d9c7" + "macos": "490bae1c392b3b344b0270afd8cb887da4bc50bd92c0c426e96713c1ccb9701a", + "windows-x64": "c2dd03fa7fd01fad5beafce8f7156da11f9ed9a588373fd40b44a06f4c03b867" } }, "prebuilt": { - "version": "2023-11-03", + "version": "2024-03-19", "baseUrl": "https://github.com/obsproject/obs-deps/releases/download", "label": "Pre-Built obs-deps", "hashes": { - "macos": "90c2fc069847ec2768dcc867c1c63b112c615ed845a907dc44acab7a97181974", - "windows-x64": "d0825a6fb65822c993a3059edfba70d72d2e632ef74893588cf12b1f0d329ce6" + "macos": "2e9bfb55a5e0e4c1086fa1fda4cf268debfead473089df2aaea80e1c7a3ca7ff", + "windows-x64": "6e86068371526a967e805f6f9903f9407adb683c21820db5f07da8f30d11e998" } }, "qt6": { - "version": "2023-11-03", + "version": "2024-03-19", "baseUrl": "https://github.com/obsproject/obs-deps/releases/download", "label": "Pre-Built Qt6", "hashes": { - "macos": "ba4a7152848da0053f63427a2a2cb0a199af3992997c0db08564df6f48c9db98", - "windows-x64": "bc57dedf76b47119a6dce0435a2f21b35b08c8f2948b1cb34a157320f77732d1" + "macos": "694f1e639c017e3b1f456f735330dc5afae287cbea85757101af1368de3142c8", + "windows-x64": "72d1df34a0ef7413a681d5fcc88cae81da60adc03dcd23ef17862ab170bcc0dd" }, "debugSymbols": { - "windows-x64": "fd8ecd1d8cd2ef049d9f4d7fb5c134f784836d6020758094855dfa98bd025036" + "windows-x64": "fbddd1f659c360f2291911ac5709b67b6f8182e6bca519d24712e4f6fd3cc865" } } }, diff --git a/cmake/common/buildnumber.cmake b/cmake/common/buildnumber.cmake index bc37420..ef7af76 100644 --- a/cmake/common/buildnumber.cmake +++ b/cmake/common/buildnumber.cmake @@ -12,8 +12,14 @@ if(NOT DEFINED PLUGIN_BUILD_NUMBER AND EXISTS "${_BUILD_NUMBER_CACHE}") file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER) math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1") elseif(NOT DEFINED PLUGIN_BUILD_NUMBER) - if($ENV{CI} AND $ENV{GITHUB_RUN_ID}) - set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}") + if($ENV{CI}) + if($ENV{GITHUB_RUN_ID}) + set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}") + elseif($ENV{GITLAB_RUN_ID}) + set(PLUGIN_BUILD_NUMBER "$ENV{GITLAB_RUN_ID}") + else() + set(PLUGIN_BUILD_NUMBER "1") + endif() else() set(PLUGIN_BUILD_NUMBER "1") endif() diff --git a/cmake/common/helpers_common.cmake b/cmake/common/helpers_common.cmake index b61fa54..cdae2b1 100644 --- a/cmake/common/helpers_common.cmake +++ b/cmake/common/helpers_common.cmake @@ -6,91 +6,6 @@ include_guard(GLOBAL) -# * Use QT_VERSION value as a hint for desired Qt version -# * If "AUTO" was specified, prefer Qt6 over Qt5 -# * Creates versionless targets of desired component if none had been created by Qt itself (Qt versions < 5.15) -if(NOT QT_VERSION) - set(QT_VERSION - AUTO - CACHE STRING "OBS Qt version [AUTO, 5, 6]" FORCE) - set_property(CACHE QT_VERSION PROPERTY STRINGS AUTO 5 6) -endif() - -# find_qt: Macro to find best possible Qt version for use with the project: -macro(find_qt) - set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC COMPONENTS_LINUX) - cmake_parse_arguments(find_qt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - # Do not use versionless targets in the first step to avoid Qt::Core being clobbered by later opportunistic - # find_package runs - set(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE) - - message(DEBUG "Start Qt version discovery...") - # Loop until _QT_VERSION is set or FATAL_ERROR aborts script execution early - while(NOT _QT_VERSION) - message(DEBUG "QT_VERSION set to ${QT_VERSION}") - if(QT_VERSION STREQUAL AUTO AND NOT qt_test_version) - set(qt_test_version 6) - elseif(NOT QT_VERSION STREQUAL AUTO) - set(qt_test_version ${QT_VERSION}) - endif() - message(DEBUG "Attempting to find Qt${qt_test_version}") - - find_package( - Qt${qt_test_version} - COMPONENTS Core - QUIET) - - if(TARGET Qt${qt_test_version}::Core) - set(_QT_VERSION - ${qt_test_version} - CACHE INTERNAL "") - message(STATUS "Qt version found: ${_QT_VERSION}") - unset(qt_test_version) - break() - elseif(QT_VERSION STREQUAL AUTO) - if(qt_test_version EQUAL 6) - message(WARNING "Qt6 was not found, falling back to Qt5") - set(qt_test_version 5) - continue() - endif() - endif() - message(FATAL_ERROR "Neither Qt6 nor Qt5 found.") - endwhile() - - # Enable versionless targets for the remaining Qt components - set(QT_NO_CREATE_VERSIONLESS_TARGETS FALSE) - - set(qt_components ${find_qt_COMPONENTS}) - if(OS_WINDOWS) - list(APPEND qt_components ${find_qt_COMPONENTS_WIN}) - elseif(OS_MACOS) - list(APPEND qt_components ${find_qt_COMPONENTS_MAC}) - else() - list(APPEND qt_components ${find_qt_COMPONENTS_LINUX}) - endif() - message(DEBUG "Trying to find Qt components ${qt_components}...") - - find_package(Qt${_QT_VERSION} REQUIRED ${qt_components}) - - list(APPEND qt_components Core) - - if("Gui" IN_LIST find_qt_COMPONENTS_LINUX) - list(APPEND qt_components "GuiPrivate") - endif() - - # Check for versionless targets of each requested component and create if necessary - foreach(component IN LISTS qt_components) - message(DEBUG "Checking for target Qt::${component}") - if(NOT TARGET Qt::${component} AND TARGET Qt${_QT_VERSION}::${component}) - add_library(Qt::${component} INTERFACE IMPORTED) - set_target_properties(Qt::${component} PROPERTIES INTERFACE_LINK_LIBRARIES Qt${_QT_VERSION}::${component}) - endif() - set_property(TARGET Qt::${component} PROPERTY INTERFACE_COMPILE_FEATURES "") - endforeach() - -endmacro() - # check_uuid: Helper function to check for valid UUID function(check_uuid uuid_string return_value) set(valid_uuid TRUE)