Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/run-gersemi/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 31 additions & 11 deletions build-aux/.run-format.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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)/*})
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cmake/common/buildspec_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions cmake/common/helpers_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ function(find_qt_plugins)
endif()

list(
APPEND
qt_plugins_Core
APPEND qt_plugins_Core
platforms
printsupport
styles
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindAMF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindAsio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]+"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindCEF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
12 changes: 4 additions & 8 deletions cmake/finders/FindFFmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,22 @@ 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]*$"
)
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _version_minor "${_version_string}")
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]*$"
)
Expand Down Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindFFnvcodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindLibAJANTV2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindLibVLC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindLibva.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
6 changes: 2 additions & 4 deletions cmake/finders/FindMbedTLS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]+.+"
)
Expand All @@ -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]+.+"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindPipeWire.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindPulseAudio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindSIMDe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]*$"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindUthash.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]+"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/finders/FindWebsocketpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]+"
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/linux/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/macos/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/windows/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
3 changes: 1 addition & 2 deletions libobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions shared/obs-scripting/obspython/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ swig_add_library(obspython LANGUAGE python TYPE MODULE SOURCES obspython.i)
add_library(OBS::python ALIAS obspython)

file(
GENERATE OUTPUT
$<$<PLATFORM_ID:Windows>:$<CONFIG>/>obspython.h
GENERATE OUTPUT $<$<PLATFORM_ID:Windows>:$<CONFIG>/>obspython.h
CONTENT "#pragma once\n\n#define PYTHON_LIB \"$<TARGET_LINKER_FILE_NAME:Python::Python>\"\n"
)

Expand Down
Loading