408 Commits

Author SHA1 Message Date
Sebastian Beckmann
f4bb61f472 cmake: Disable char8_t on macOS with C++20
This is already disabled for other platforms, but the clang options
aren't applied on macOS.

Amends 8d33da1fab.
2025-12-18 17:30:42 -05:00
PatTheMav
cf5ef3e414 cmake: Remove Ccache option to enforce second preprocessor call
Feature was removed in Ccache 4.12, which is provided by Homebrew by
default since 2025-10-19.
2025-09-19 14:26:29 -04:00
Ryan Foster
21f2d97af8 Reapply "cmake: Use fixed SOVERSION everywhere"
This reverts commit 551f203499.
2025-09-08 17:09:00 -04:00
Ryan Foster
128b767a2f Reapply "cmake: Avoid breaking ABI through major version bump on Linux"
This reverts commit e0aa7c2943.
2025-09-08 17:09:00 -04:00
Ryan Foster
70d03a119d Revert "cmake: Remove library compat symlink on Linux"
This reverts commit 9b2662117a.
2025-09-08 17:09:00 -04:00
PatTheMav
b0fa60ae17 cmake: Enable DEBUG flag for Swift 2025-09-04 17:58:27 -04:00
tytan652
9b2662117a cmake: Remove library compat symlink on Linux 2025-09-04 16:29:17 -04:00
tytan652
e0aa7c2943 Revert "cmake: Avoid breaking ABI through major version bump on Linux"
This reverts commit 129d4f2f3f.
2025-09-04 16:29:17 -04:00
tytan652
551f203499 Revert "cmake: Use fixed SOVERSION everywhere"
This reverts commit cc36ccd07d.
2025-09-04 16:29:17 -04:00
PatTheMav
2413ad16d2 cmake: Add detection of cross compiled Qt dependencies for Windows 2025-08-28 15:38:55 -04:00
PatTheMav
07176822ad cmake: Enable interprocedural optimization for Release configuration
The built-in CMake variable will set the appropriate compiler flags
for supported compilers and compiler versions.
2025-08-22 15:12:55 -04:00
tytan652
2bd23cd50d libobs,cmake: Replace vendored SIMD Everywhere by prefix/system install
SIMD Everywhere finder needs to be installed alongside libobs CMake
package since its headers depends on it.

C++ cmath header is included on Windows on ARM to ensure that all math
functions are correctly defined when included in C++ code.
https://github.com/simd-everywhere/simde/issues/1304

macOS intrinsics is included to make sure that no redefinition error
happens.
2025-08-21 15:22:08 -04:00
tytan652
570f2641f4 cmake: Add a finder for SIMD Everywhere 2025-08-21 15:22:08 -04:00
PatTheMav
4c912358a9 cmake: Remove enforced architectures for macOS builds
Ideally CMAKE_OSX_ARCHITECTURES should not be set automatically within
the project but should exclusively be a cache or environment variable
provided by the developer.

This would also match the requirement mentioned by the CMake
documentation that the value should be set before the first project()
call.

If this variable is not set, the Xcode generator would default to the
native platform of the host, but the buildspec system as well as the
"add_obs_plugin" function need a local "architecture" to work, so
use "CMAKE_HOST_SYSTEM_PROCESSOR" instead if CMAKE_OSX_ARCHITECTURES
was not provided.
2025-08-19 17:59:22 -04:00
PatTheMav
ab01c406c2 cmake: Update formatting introduced by gersemi 0.21.0 2025-08-01 19:02:04 +02:00
PatTheMav
4f2d752fa7 cmake: Remove outdated and incorrect code comment in osconfig module 2025-08-01 19:02:04 +02:00
tytan652
1bf84a6901 cmake: Replace Xcb CMake finders with ECM 2025-04-28 13:30:26 -04:00
tytan652
190389ec11 cmake: Replace Wayland CMake finder with ECM 2025-04-28 13:30:26 -04:00
tytan652
e53293a785 cmake: Use Extra CMake Modules on Linux 2025-04-28 13:30:26 -04:00
jcm
8f1bcc1798 cmake: Adjust macOS SDK detection 2025-03-31 14:10:38 -04:00
Ryan Foster
f590a35bf7 cmake: Fix some Qt DLLs not being copied due to filename patterns
Qt has some Release DLLs that end with the letter d:
* qdirect2d.dll
* qcertonlybackend.dll
* qopensslbackend.dll
* qschannelbackend.dll

As a result, they get caught by our simple check for if a DLL is a Debug
DLL which just checks if the DLL ends with the letter d.

Extend that check to exclude these specific DLLs from being marked as
Debug DLLs.
2025-03-14 11:47:54 -04:00
PatTheMav
df97bddd87 cmake: Update cross-platform build project management for Windows
Enables creation of x64 and x86 child projects when building on ARM64
and decouples functionality from legacy_check function
2025-03-12 16:33:00 -04:00
Matt Gajownik
0bcf881ae9 cmake: Don't copy legacy, unused Chromium file
While CEF continues to ship & read this up to and including in CEF 6834,
it hasn't actually been used since Chromium 66, so we can safely remove
it without causing regressions in 5060 or 6533.

719f423e70
2025-02-28 18:38:31 -05:00
Ryan Foster
e471d3109b cmake: Specify NOMINMAX all the time on Windows
This prevents the Windows headers from defining min/max macros.

Use std::min and std::max.

Modifies deps, frontend, libobs-d3d11, libobs-winrt, decklink, obs-vst,
and win-dshow.
2025-02-07 14:52:24 -05:00
gxalpha
ba84bea46d libobs: Rewrite macOS Hotkeys to use CGEventTap
Using CGEventTapCreate instead of addGlobalMonitorForEventsMatchingMask
to listen to global hotkeys has the advantage of tighter control over
what permissions we need. Since we only listen to and do not modify the
event, it is enough to have "Input Monitoring" instead of the full
"Accessibility" (which would allow modifying the event after catching
it).
2025-02-05 14:33:06 -05:00
Yann Salmon
9b97d48573 cmake: Fix regexp to detect installed FFmpeg version
The regexp was not tolerating a + sign is the version string,
causing configuration to fail on Ubuntu 24.04 when the installed
version is 6.1.1-3ubuntu5+esm2.
2025-02-05 12:22:36 -05:00
PatTheMav
45a89ab199 cmake: Update macOS development version requirements
To be able to make use of macOS 15 features, development must use the
macOS 15 SDK and in turn Xcode 16.0 (or more recent).
2025-01-23 16:43:37 -05:00
PatTheMav
7db4a75913 cmake: Update main CMakeLists file to use refactored frontend 2025-01-08 17:33:13 +01:00
Ryan Foster
c8e215be3d cmake: Fix build directory exclusion for real
Upon further review, the build directory is never set to build_$arch.
Currently, our CMake Presets on Ubuntu only use build_ubuntu. However,
we can attempt to be flexible here and simply exclude the build
directory configured in CMake.
2024-11-26 16:05:53 -05:00
Ryan Foster
b5f4958eac cmake: Fix build directory exclusion
The regex was incorrectly excluding any file with build in the name. The
intent was to exclude any build directories, so we should be able to
restrict this.
2024-11-15 15:30:09 -05:00
tytan652
52a0486c4c cmake/plugins: Enable -Wswitch on GCC
This warning is already enabled for Clang which causes issue for things
that are usually built with MSVC or GCC (e.g. non-macOS plugins).

obs-nvenc switch warning is also fixed in this commit.
obs-qsv11 has switch warning set to not become errors.
2024-10-25 13:01:33 -04:00
tytan652
2e075f7513 cmake: Fix target_add_resource ARGN support on Linux
This fixes how the AUTHORS file is installed.
2024-10-24 15:08:37 -04:00
Kurt Kartaltepe
cc36ccd07d cmake: Use fixed SOVERSION everywhere
We missed a spot when freezing the SOVERSION to 30 after we flipped to
31 causing builds to break.
2024-10-05 14:03:14 -07:00
PatTheMav
32cfa1626f UI: Fix missing support for portable configuration files
Windows and Linux allow the storage of configuration files relative
to the binary location, which is enabled by default on Windows and has
to be explicitly enabled on Linux.

This was originally conflated with the LINUX_PORTABLE build setting
which also allowed the application itself to be run from non-default
locations on a Linux system.

This change reintroduces the functionality behind the
ENABLE_PORTABLE_CONFIG build setting on Linux.

It also adds necessary code to make this setting compatible with the
recently introduced relocatable settings code changes:

When portable mode is enabled, user configuration, scene collections,
and profiles are stored in the config directory created for portable
mode.
2024-09-26 14:39:44 -04:00
PatTheMav
51d66dcedf cmake: Change library discovery order in LuaJIT find module
To ensure that the find module prefers the variant of LuaJIT shipped
as part of obs-deps, it's necessary to give the name as shipped in
obs-deps the highest precedence.

This ensures that the "find_library" call will discover the less
version-specific variant of the library possibly installed via
Homebrew.
2024-09-26 14:14:55 -04:00
PatTheMav
ace60a655c cmake: Disable discovery of Homebrew libraries for dependencies
macOS builds should only use dependencies built via the obs-deps
build scripts. Default variants of the same dependencies are not
compatible with our app packaging requirements and thus will create
issues when creating the app bundle.

This is specifically an issue when MbedTLS is installed via Homebrew
which ships a CMake package config by default and is picked up
by our code ever since we switched to prefer CMake packages.
2024-09-26 14:14:55 -04:00
PatTheMav
f9f974fe7b cmake: Update use of MbedTLS to support update to version 3.6.0
MbedTLS changed a lot of internals with their LTS version 3.6.0, which
are incompatible with the find module currently shipped with
OBS Studio.

The solution requires several changes to be applied at once:

* Rename the generated target name to MbedTLS::mbedtls to match the
  name used by MbedTLS' own CMake package
* Update find module to use the updated target name(s)
* Set CMAKE_FIND_PACKAGE_PREFER_CONFIG to TRUE before trying to find
  MbedTLS to ensure that CMake package files are used with priority
  (Those are shipped only with MbedTLS 3.6.0 in obs-deps).
* A deprecation warning is emitted if the find module is used with
  MbedTLS 3.6.0 available
2024-09-13 18:30:42 -04:00
PatTheMav
6c590805e8 cmake: Update supported CMake version range to 3.28 and 3.30 2024-09-13 14:42:32 -04:00
PatTheMav
cfc12d0543 cmake: Disable CCache for local builds and enable by default for CI 2024-09-12 17:45:29 -04:00
gxalpha
922e2cc151 cmake: Remove remaining cmake-format comments
cmake-format was replaced with gersemi in
19d3e30a3a. As such, these comments no
longer have any effect.
2024-09-12 14:20:28 -04:00
tytan652
31385006d5 Remove legacy_check CMake macro
The macro was not removed in 72428ccd97
waiting for submodules to be be updated to a commit where their legacy
code path is removed.
2024-09-11 13:24:39 -04:00
Norihiro Kamae
14aaaa325b cmake/linux: Move color diagnostics setting to preset for ubuntu-ci
This also removes color diagnostics setting for cmake < 3.24.
2024-09-10 14:30:17 -04:00
tytan652
129d4f2f3f cmake: Avoid breaking ABI through major version bump on Linux
Freeze SOVERSION to 30, this number is to be incremented when a clean
break is wanted.
2024-09-10 00:41:26 -04:00
gxalpha
296a2b8631 cmake: Exclude macOS .DS_Store from resources 2024-08-31 10:39:11 -04:00
tytan652
72428ccd97 Remove CMake legacy code path
Except submodules and legacy_check macro since the former depend on it.
2024-08-28 13:53:25 -04:00
PatTheMav
d81fcd70e0 cmake: Update cross-platform build project management for Windows
Enables creation of x64 and x86 child projects when building on ARM64
and decouples functionality from legacy_check function
2024-08-20 16:00:21 -04:00
PatTheMav
c89cef3aa5 cmake: Fix malformed CMake package location on Windows
CMake doesn't expect CMake package files to be separated in
subdirectories on Windows and instead expects all files to be put in
a single directory `cmake` found within one of the PREFIX paths.

Also fixes circular dependency in w32-pthreads CMake package config
file.
2024-08-20 14:48:08 -04:00
PatTheMav
b8cfacaec3 Update formatting of CMake files 2024-08-14 12:07:47 -04:00
tytan652
8480660bf8 cmake: Add architecture support to add_obs_plugin
Also add formatting support to the function
2024-07-29 18:11:29 -04:00
Penwywern
4517918c7a cmake: Fix FFmpeg version regex 2024-06-26 12:26:56 -04:00