diff --git a/.github/actions/run-gersemi/action.yaml b/.github/actions/run-gersemi/action.yaml index 5a6818f91a9bd1..33571402b0a831 100644 --- a/.github/actions/run-gersemi/action.yaml +++ b/.github/actions/run-gersemi/action.yaml @@ -50,7 +50,7 @@ runs: if (( ${+RUNNER_DEBUG} )) setopt XTRACE print ::group::Install gersemi - brew install --quiet obsproject/tools/gersemi + brew install --quiet obsproject/tools/gersemi@0.25 print ::endgroup:: print ::group::Run gersemi diff --git a/build-aux/.run-format.zsh b/build-aux/.run-format.zsh index ab74d28355d430..6d65893bf83629 100755 --- a/build-aux/.run-format.zsh +++ b/build-aux/.run-format.zsh @@ -92,16 +92,23 @@ invoke_formatter() { } ;; gersemi) - local formatter=gersemi - if (( ${+commands[gersemi]} )) { - local gersemi_version=($(gersemi --version)) - if ! is-at-least 0.21.0 ${gersemi_version[2]}; then - log_error "gersemi is not version 0.21.0 or above (found ${gersemi_version[2]}." - exit 2 - fi + if (( ${+commands[gersemi-0.25]} )) { + local formatter=gersemi-0.25 + } elif (( ${+commands[gersemi]} )) { + local formatter=gersemi + } else { + log_error "No viable gersemi version found (required 0.25.0)" + exit 2 } + local gersemi_version=($(${formatter} --version)) + + if ! is-at-least 0.25.0 ${gersemi_version[2]}; then + log_error "gersemi is not version 0.25.0 or above (found ${gersemi_version[2]}." + exit 2 + fi + if (( ! #source_files )) source_files=(CMakeLists.txt (libobs|libobs-*|frontend|plugins|deps|shared|cmake|test)/**/(CMakeLists.txt|*.cmake)(.N)) source_files=(${source_files:#*/(jansson|decklink/*/decklink-sdk|obs-websocket|obs-browser|libdshowcapture)/*}) @@ -112,16 +119,29 @@ invoke_formatter() { local -a source_files=($@) local file local -a command=(${formatter} -c --no-cache ${source_files}) + local -i in_error=0 if (( ${#source_files} )) { while read -r line; do local -a line_tokens=(${(z)line}) if (( #line_tokens )) { - file=${line_tokens[1]//*${project_root}\//} - - log_error "${file} requires formatting changes." + file=${line_tokens[1]} + + if [[ -r ${file} ]] { + in_error=0 + file=${file//*${project_root}\//} + + log_error "${file} requires formatting changes." + } else { + if (( in_error )) { + log_output "${line}" + } else { + log_error "${line}" + } + in_error=1 + } } else { - log_error "${line}" + log_output "${line}" } if (( fail_on_error == 2 )) return 2 diff --git a/cmake/common/buildspec_common.cmake b/cmake/common/buildspec_common.cmake index d5d02cb994c94e..ac5286ea1b5bda 100644 --- a/cmake/common/buildspec_common.cmake +++ b/cmake/common/buildspec_common.cmake @@ -92,8 +92,7 @@ function(_check_dependencies) if(EXISTS "${dependencies_dir}/.dependency_${dependency}_${arch}.sha256") file( - READ - "${dependencies_dir}/.dependency_${dependency}_${arch}.sha256" + READ "${dependencies_dir}/.dependency_${dependency}_${arch}.sha256" OBS_DEPENDENCY_${dependency}_${arch}_HASH ) endif() diff --git a/cmake/common/helpers_common.cmake b/cmake/common/helpers_common.cmake index 7f7d6eac7babcb..4ce77230a09a4b 100644 --- a/cmake/common/helpers_common.cmake +++ b/cmake/common/helpers_common.cmake @@ -227,8 +227,7 @@ function(find_qt_plugins) endif() list( - APPEND - qt_plugins_Core + APPEND qt_plugins_Core platforms printsupport styles diff --git a/cmake/finders/FindAMF.cmake b/cmake/finders/FindAMF.cmake index 0a24f40406efef..142331e258a33e 100644 --- a/cmake/finders/FindAMF.cmake +++ b/cmake/finders/FindAMF.cmake @@ -37,8 +37,7 @@ find_path(AMF_INCLUDE_DIR NAMES AMF/core/Factory.h PATHS /usr/include /usr/local if(EXISTS "${AMF_INCLUDE_DIR}/AMF/core/Version.h") file( - STRINGS - "${AMF_INCLUDE_DIR}/AMF/core/Version.h" + STRINGS "${AMF_INCLUDE_DIR}/AMF/core/Version.h" _version_string REGEX "^.*VERSION_(MAJOR|MINOR|RELEASE|BUILD_NUM)[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindAsio.cmake b/cmake/finders/FindAsio.cmake index 6cdae9bb3c854e..3ea564f90ed472 100644 --- a/cmake/finders/FindAsio.cmake +++ b/cmake/finders/FindAsio.cmake @@ -50,8 +50,7 @@ if(PC_Asio_VERSION VERSION_GREATER 0) set(Asio_VERSION ${PC_Asio_VERSION}) elseif(EXISTS "${Asio_INCLUDE_DIR}/asio/version.hpp") file( - STRINGS - "${Asio_INCLUDE_DIR}/asio/version.hpp" + STRINGS "${Asio_INCLUDE_DIR}/asio/version.hpp" _version_string REGEX "#define[ \t]+ASIO_VERSION[ \t]+[0-9]+[ \t]+\\/\\/[ \t][0-9]+\\.[0-9]+\\.[0-9]+" ) diff --git a/cmake/finders/FindCEF.cmake b/cmake/finders/FindCEF.cmake index 2366f0b2d64666..f07eda39f34102 100644 --- a/cmake/finders/FindCEF.cmake +++ b/cmake/finders/FindCEF.cmake @@ -71,8 +71,7 @@ find_path( if(CEF_INCLUDE_DIR) file( - STRINGS - "${CEF_INCLUDE_DIR}/cef_version.h" + STRINGS "${CEF_INCLUDE_DIR}/cef_version.h" _VERSION_STRING REGEX "^.*CEF_VERSION_(MAJOR|MINOR|PATCH)[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindFFmpeg.cmake b/cmake/finders/FindFFmpeg.cmake index d5200ced887e80..ecba82d397315d 100644 --- a/cmake/finders/FindFFmpeg.cmake +++ b/cmake/finders/FindFFmpeg.cmake @@ -202,16 +202,14 @@ macro(FFmpeg_check_version) elseif(EXISTS "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version.h") if(EXISTS "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version_major.h") file( - STRINGS - "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version_major.h" + STRINGS "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version_major.h" _version_string REGEX "^.*VERSION_MAJOR[ \t]+[0-9]+[ \t]*$" ) string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _version_major "${_version_string}") file( - STRINGS - "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version.h" + STRINGS "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version.h" _version_string REGEX "^.*VERSION_(MINOR|MICRO)[ \t]+[0-9]+[ \t]*$" ) @@ -219,8 +217,7 @@ macro(FFmpeg_check_version) string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _version_patch "${_version_string}") else() file( - STRINGS - "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version.h" + STRINGS "${FFmpeg_${component}_INCLUDE_DIR}/${component_libname}/version.h" _version_string REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$" ) @@ -292,8 +289,7 @@ endif() if(EXISTS "${FFmpeg_avutil_INCLUDE_DIR}/libavutil/ffversion.h") file( - STRINGS - "${FFmpeg_avutil_INCLUDE_DIR}/libavutil/ffversion.h" + STRINGS "${FFmpeg_avutil_INCLUDE_DIR}/libavutil/ffversion.h" _version_string REGEX "^.*FFMPEG_VERSION[ \t]+\"n?[0-9a-z\\~+.-]+\"[ \t]*$" ) diff --git a/cmake/finders/FindFFnvcodec.cmake b/cmake/finders/FindFFnvcodec.cmake index 3d6564f5857278..80363a3c86273f 100644 --- a/cmake/finders/FindFFnvcodec.cmake +++ b/cmake/finders/FindFFnvcodec.cmake @@ -50,8 +50,7 @@ if(PC_FFnvcodec_VERSION VERSION_GREATER 0) set(FFnvcodec_VERSION ${PC_FFnvcodec_VERSION}) elseif(EXISTS "${FFnvcodec_INCLUDE_DIR}/ffnvcodec/nvEncodeAPI.h") file( - STRINGS - "${FFnvcodec_INCLUDE_DIR}/ffnvcodec/nvEncodeAPI.h" + STRINGS "${FFnvcodec_INCLUDE_DIR}/ffnvcodec/nvEncodeAPI.h" _version_string REGEX "^.*NVENCAPI_(MAJOR|MINOR)_VERSION[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindLibAJANTV2.cmake b/cmake/finders/FindLibAJANTV2.cmake index 9418f04cd60f41..460d91c4af34c2 100644 --- a/cmake/finders/FindLibAJANTV2.cmake +++ b/cmake/finders/FindLibAJANTV2.cmake @@ -122,8 +122,7 @@ unset(LibAJANTV2_ERROR_REASON) if(LibAJANTV2_FOUND) list( - APPEND - LibAJANTV2_INCLUDE_DIRS + APPEND LibAJANTV2_INCLUDE_DIRS ${LibAJANTV2_INCLUDE_DIR} ${LibAJANTV2_INCLUDE_DIR}/ajaanc ${LibAJANTV2_INCLUDE_DIR}/ajabase diff --git a/cmake/finders/FindLibVLC.cmake b/cmake/finders/FindLibVLC.cmake index bae5d1969b0b9c..80fe6fd123f3bc 100644 --- a/cmake/finders/FindLibVLC.cmake +++ b/cmake/finders/FindLibVLC.cmake @@ -64,8 +64,7 @@ if(PC_LibVLC_VERSION VERSION_GREATER 0) set(LibVLC_VERSION ${PC_LibVLC_VERSION}) elseif(EXISTS "${LibVLC_INCLUDE_DIR}/libvlc_version.h") file( - STRINGS - "${LibVLC_INCLUDE_DIR}/libvlc_version.h" + STRINGS "${LibVLC_INCLUDE_DIR}/libvlc_version.h" _VERSION_STRING REGEX "^.*LIBVLC_VERSION_(MAJOR|MINOR|PATCH)[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindLibva.cmake b/cmake/finders/FindLibva.cmake index 9a0089c7caa71b..757f6e988a93ff 100644 --- a/cmake/finders/FindLibva.cmake +++ b/cmake/finders/FindLibva.cmake @@ -79,8 +79,7 @@ if(PC_Libva_VERSION VERSION_GREATER 0) set(Libva_VERSION ${PC_Libva_VERSION}) elseif(EXISTS "${Libva_INCLUDE_DIR}/va_version.h") file( - STRINGS - "${Libva_INCLUDE_DIR}/va_version.h" + STRINGS "${Libva_INCLUDE_DIR}/va_version.h" _VERSION_STRING REGEX "^.*(MAJOR|MINOR|MICRO)_VERSION[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindMbedTLS.cmake b/cmake/finders/FindMbedTLS.cmake index 5b9d9d95536e90..f6fa184e9376c4 100644 --- a/cmake/finders/FindMbedTLS.cmake +++ b/cmake/finders/FindMbedTLS.cmake @@ -109,8 +109,7 @@ if(PC_MbedTLS_VERSION VERSION_GREATER 0) set(MbedTLS_VERSION ${PC_MbedTLS_VERSION}) elseif(EXISTS "${MbedTLS_INCLUDE_DIR}/mbedtls/build_info.h") file( - STRINGS - "${MbedTLS_INCLUDE_DIR}/mbedtls/build_info.h" + STRINGS "${MbedTLS_INCLUDE_DIR}/mbedtls/build_info.h" _VERSION_STRING REGEX "#define[ \t]+MBEDTLS_VERSION_STRING[ \t]+.+" ) @@ -123,8 +122,7 @@ elseif(EXISTS "${MbedTLS_INCLUDE_DIR}/mbedtls/build_info.h") ) elseif(EXISTS "${MbedTLS_INCLUDE_DIR}/mbedtls/version.h") file( - STRINGS - "${MbedTLS_INCLUDE_DIR}/mbedtls/version.h" + STRINGS "${MbedTLS_INCLUDE_DIR}/mbedtls/version.h" _VERSION_STRING REGEX "#define[ \t]+MBEDTLS_VERSION_STRING[ \t]+.+" ) diff --git a/cmake/finders/FindPipeWire.cmake b/cmake/finders/FindPipeWire.cmake index 377dcd776334a6..3c6447654638ae 100644 --- a/cmake/finders/FindPipeWire.cmake +++ b/cmake/finders/FindPipeWire.cmake @@ -74,8 +74,7 @@ if(PC_PipeWire_VERSION VERSION_GREATER 0) set(PipeWire_VERSION ${PC_PipeWire_VERSION}) elseif(EXISTS "${PipeWire_INCLUDE_DIR}/pipewire/version.h") file( - STRINGS - "${PipeWire_INCLUDE_DIR}/pipewire/version.h" + STRINGS "${PipeWire_INCLUDE_DIR}/pipewire/version.h" _version_string REGEX "^.*PW_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindPulseAudio.cmake b/cmake/finders/FindPulseAudio.cmake index d4aaa762831819..798b4d3a1c48b5 100644 --- a/cmake/finders/FindPulseAudio.cmake +++ b/cmake/finders/FindPulseAudio.cmake @@ -63,8 +63,7 @@ if(PC_PulseAudio_VERSION VERSION_GREATER 0) set(PulseAudio_VERSION ${PC_PulseAudio_VERSION}) elseif(EXISTS "${PulseAudio_INCLUDE_DIR}/version.h") file( - STRINGS - "${PulseAudio_INCLUDE_DIR}/version.h" + STRINGS "${PulseAudio_INCLUDE_DIR}/version.h" _VERSION_STRING REGEX "^.*pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\)[ \t]*$" ) diff --git a/cmake/finders/FindSIMDe.cmake b/cmake/finders/FindSIMDe.cmake index c2fbc541102c31..f58a9542957a72 100644 --- a/cmake/finders/FindSIMDe.cmake +++ b/cmake/finders/FindSIMDe.cmake @@ -48,8 +48,7 @@ find_path( if(EXISTS "${SIMDe_INCLUDE_DIR}/simde/simde-common.h") file( - STRINGS - "${SIMDe_INCLUDE_DIR}/simde/simde-common.h" + STRINGS "${SIMDe_INCLUDE_DIR}/simde/simde-common.h" _version_string REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$" ) diff --git a/cmake/finders/FindUthash.cmake b/cmake/finders/FindUthash.cmake index e3e1d5f0d86191..3eb7e8a2ef5473 100644 --- a/cmake/finders/FindUthash.cmake +++ b/cmake/finders/FindUthash.cmake @@ -37,8 +37,7 @@ find_path(Uthash_INCLUDE_DIR NAMES uthash.h PATHS /usr/include /usr/local/includ if(EXISTS "${Uthash_INCLUDE_DIR}/uthash.h") file( - STRINGS - "${Uthash_INCLUDE_DIR}/uthash.h" + STRINGS "${Uthash_INCLUDE_DIR}/uthash.h" _version_string REGEX "#define[ \t]+UTHASH_VERSION[ \t]+[0-9]+\\.[0-9]+\\.[0-9]+" ) diff --git a/cmake/finders/FindWebsocketpp.cmake b/cmake/finders/FindWebsocketpp.cmake index 5d928596c7e954..5c39c2d9b53e66 100644 --- a/cmake/finders/FindWebsocketpp.cmake +++ b/cmake/finders/FindWebsocketpp.cmake @@ -42,8 +42,7 @@ find_path( if(EXISTS "${Websocketpp_INCLUDE_DIR}/websocketpp/version.hpp") file( - STRINGS - "${Websocketpp_INCLUDE_DIR}/websocketpp/version.hpp" + STRINGS "${Websocketpp_INCLUDE_DIR}/websocketpp/version.hpp" _version_string REGEX "^.*(major|minor|patch)_version[ \t]+=[ \t]+[0-9]+" ) diff --git a/cmake/linux/helpers.cmake b/cmake/linux/helpers.cmake index c0966e69296092..d2d38dcd250c04 100644 --- a/cmake/linux/helpers.cmake +++ b/cmake/linux/helpers.cmake @@ -227,8 +227,7 @@ function(target_install_resources target) file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*") foreach(data_file IN LISTS data_files) cmake_path( - RELATIVE_PATH - data_file + RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE relative_path ) diff --git a/cmake/macos/helpers.cmake b/cmake/macos/helpers.cmake index 2f203cd580fd6e..8913b2b24f9d96 100644 --- a/cmake/macos/helpers.cmake +++ b/cmake/macos/helpers.cmake @@ -357,8 +357,7 @@ function(target_install_resources target) list(FILTER data_files EXCLUDE REGEX "\\.DS_Store$") foreach(data_file IN LISTS data_files) cmake_path( - RELATIVE_PATH - data_file + RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE relative_path ) diff --git a/cmake/windows/helpers.cmake b/cmake/windows/helpers.cmake index b4d0bf4ddd5658..9a443f1cf75736 100644 --- a/cmake/windows/helpers.cmake +++ b/cmake/windows/helpers.cmake @@ -305,8 +305,7 @@ function(target_install_resources target) file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*") foreach(data_file IN LISTS data_files) cmake_path( - RELATIVE_PATH - data_file + RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE relative_path ) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index 3dc0a28e1852d1..b20c2fa476ce5c 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -356,8 +356,7 @@ set( if(OS_WINDOWS) list( - APPEND - public_headers + APPEND public_headers util/threading-windows.h util/windows/ComPtr.hpp util/windows/CoTaskMemPtr.hpp diff --git a/shared/obs-scripting/obspython/CMakeLists.txt b/shared/obs-scripting/obspython/CMakeLists.txt index 837032f15db4da..28266ca474cf6c 100644 --- a/shared/obs-scripting/obspython/CMakeLists.txt +++ b/shared/obs-scripting/obspython/CMakeLists.txt @@ -31,8 +31,7 @@ swig_add_library(obspython LANGUAGE python TYPE MODULE SOURCES obspython.i) add_library(OBS::python ALIAS obspython) file( - GENERATE OUTPUT - $<$:$/>obspython.h + GENERATE OUTPUT $<$:$/>obspython.h CONTENT "#pragma once\n\n#define PYTHON_LIB \"$\"\n" )