Copy libdatachannel DLL whether it's compiled on MSVC (and named
datachannel.dll) or cross-compiled on MinGW (and named
libdatachannel.dll).
Signed-off-by: pkv <pkv@obsproject.com>
Generated post build action batch scripts retained an empty token to
the copy command with the used generator expression (as PDBs are only
generated for Debug and RelWithDebInfo configurations).
Moving their copy step into its own command (and using the `true`
CMake command, which is a no-op) ensures that builds in Release and
MinSizeRel correctly finish this step.
Creation of Info.plist files through Xcode is more canonical and
future-proof, as it will automatically pick up changes/updates
introduced by Apple. Non-standard keys can still be added via a
template file, which will then be extended by Xcode with the default
keys.
Compiler extensions are disabled before the first `project` call to
force CMake into considering compilers to not support GNU extensions
(even though clang and gcc do).
Also sets common clang compiler options so they can be used across all
supported platforms.
`openmp-simd` support is enabled by default as there is no performance
penalty on x86_64 systems and intrinsics are enabled on arm64.
Also implements CMake's `CMAKE_COMPILE_WARNING_AS_ERROR` flag to
enable the desired behavior and configuration time.
Include guards ensure that bootstrap includes happen only once for the
entire project. Moving all policy changes into an included file without
its own policy scope ensures that the policy is applied to the project.
Also restores original order of compiler flags and more explicitly
splits up flags for the specific languages in which they take effect.
Notice that ObjC and ObjC++ follow a slightly stricter set of rules
than C and C++, which is reflected by this fix.
Frameworks should be archived and exported (where they will be
codesigned by Xcode) or shipped within an App bundle where Xcode will
also take care of it.
Updates the syphon to use the Syphon.framework from obs-deps instead of
the submodule.
The submodule however was not updated in 9 years and additionally had
custom patches, compared to the obs-deps release that's built on the
current git commit of Syphon, meaning that some code changes are
necessary. It would be nice to split the code and cmake changes into
multiple commits (where the first would update the submodule and contain
the plugin code changes, and the second switch the cmake away from the
submodule to the obs-deps release), but it really doesn't make sense to
update the submodule first if it gets removed anyways.
Adds a subclass for SyphonClientBase that is responsible for receiving
the frames. This has the advantage that it doesn't need an OpenGL
context like the existing SyphonOpenGLClient, and can just return an
IOSurface directly (without some kind of middleman).
Camera Extensions require specific entitlements for the hosting app,
which also require a provisioning profile. To avoid breaking local
builds that do not require the camera extension, an additional
entitlements file that will not trigger the provisioning profile
requirement will be used if the virtualcam (but not the Camera
Extension) is configured.
VERSION comparison requires semver-compliant version strings, but
obs-deps versions are based on dates, which are not compliant. Fix
version strings to semver variants before comparison.
As there will be multiple directories containing obs-deps (non-Qt and
Qt variants), the search needs to continue after a first failed attempt
and not abort it entirely.
- Sets CMAKE_C_STANDARD to 17
- Disables C extensions (e.g. gnu17) to force ISO C on macOS/Windows
- Fixes language properties in cmake 3.0 not being set correctly
- Sets Xcode attributes to c17
OBS CMake build framework 3.0 is a minor overhaul of version 2.0. Due
to close proximity of the 2.0 rework, the amount of actual changes to
project files are minimal and mostly concern application generation.
This commit contains the bootstrap elements only and requires
OS-specific implementations to be functional.
-Wformat-security is enabled, some Linux packages build system have it
enabled.
https://github.com/obsproject/obs-studio/pull/5766
-Wunused-parameter is enabled too.
Also ensure that null conversion (C++ only for GCC) is enabled because its
enablement by default can depend on the CMake generator.
-Wswitch is enabled but it is kept as a warning. It was already enabled
with Clang.
If Clang has -Wshorten-64-to-32 enabled, keep it as warnings.
The correct way to build debian package and also provide debug symbols
is to use additional `ddeb` packages served with the original `deb`
package.
This will implicitly still strip the binaries contained in the `deb`
package (per convention) but also create a `.ddeb` package with the
stripped symbols.
The environment variable DESTDIR is commonly used to specify an install-
time prefix for installation of build artifacts (e.g. for staging an
installation in a temporary directory while keeping the overall prefixes
intact).
This variable should be ignored by all targets but the install target,
which requires us to set it to an empty string/path when we use
`install` to set up our rundir.
Qt uses a default font size of 13pt for QWidgets on macOS. By setting
the default font size to 10pt, text becomes too small for comfortable
use on macOS.
This PR patches the font files copied into the macOS bundle to use a
larger font-size of 12pt. It also sets the fallback font to the more
modern SF Display-based `.AppleSystemUIFont` used by default in macOS
if Open Sans is not found.
For exported targets `INCLUDES DESTINATION` behaves in a specific way
when running `install`: It sets the `INTERFACE_INCLUDE_DIRECTORY` for
the target (relative to the `INSTALL_PREFIX` when a relative path is
given).
This is not implicitly done by CMake, which resulted in the exported
libobs Framework to miss the variable and as such targets linking to
libobs were not able to find the necessary headers anymore.
* If a valid team id is provided, automatic code sign management is
enabled
* Different deployment targets for x86_64 and arm64 are enabled for
Xcode-based builds
* Codesign identity and code-sign style are set globally
MacOS' system information checks the CFBundleSupportedPlatforms value
in the app's property list file for the type. This was correctly set
for plugin bundles, but not binary bundles so far.
If the `git describe` command fails we want to fall back to a default
version. _OBS_DEFAULT_VERSION is not in the same format as the string
returned by `git describe` though. In the event that the command fails
just use _OBS_DEFAULT_VERSION directly rather than trying to parse it.
Fixes: cmake fails if git is not installed but .git/ exists #6940
SWIG uses the prefix target property to prefix generated Python
libraries with an underscore (so that obspython.py is loaded first,
which acts as a shim for the actual _obspython.pyd library on Windows).
Usually the prefix is set to an empty string on Windows (to avoid the
automatic "lib" prefix used by CMake), but this also removed the
necessary underscore prefix required for the Python library.
Currently the ffmpeg_mpegts_muxer output is integrated with ffmpeg-mux.
Both use obs native encoders in contrast with obs-ffmpeg-output which
relies on avcodec library.
This allowed easy implementation of SRT, RIST & HLS protocols through
avformat library.
The main drawback is that obs-ffmpeg-mux exe doesn't allow for easy
debugging nor logging of the protocols.
It was written initially as a separate binary designed for recording so
that if obs fails for some reason, the recording can still terminate
gracefully.
In this commit the ffmpeg_mpegts_muxer is rewritten so that a pipe to
the ffmpeg-mux binary is not used any more.
The muxing to mpegts is still delegated to avformat.
But it can be traced more easily in all its steps.
Also the protocol part for SRT & RIST is implemented natively.
Custom avio_contexts for SRT & RIST are used to that end.
This allows to pass our own implementation of librist and libsrt
libraries instead of relying on avformat. This is very advantageous :
- this allows better logging.
- this allows better bug fixing and maintainance without having to rely
on hypothetical upstream fixes.
One immediate bonus of native implementation is that fixes bugs which
were not previously fixable.
Fixes: SRT & RIST auto-reconnect partly broken #6749
Fixes: SRT: OBS unusable and uncloseable after starting stream to
invalid srt server #5791
Signed-off-by: pkv <pkv@obsproject.com>
If QT_VERSION is not defined, it gets define with the AUTO value. And
its definition is moved to the helper file.
find_qt now:
- Check quietly for Qt5 and Qt6
- If QT_VERSION is set to AUTO. It checks firstly if Qt5 was found it
will use it. If not it do the same for Qt6
- If QT_VERSION is set to 5 or 6, it checks if the choice was found and
use it. And if not, it falls back to the other if found.
- If neither Qt5 or Qt6 are found, a fatal error is emitted.
- The macro saved the _QT_VERSION in the cache to replace QT_VERSION,
so the process is not repeated each time that find_qt is used.
- When Qt::Gui is in the Linux component list, Qt::GuiPrivate is added.
So using the versioned one is no longer required.
Existing code didn't check for possible "empty" linked libraries
(e.g. Threads::Threads when compiler has built-in pthreads support).
Also adds support for compile options defined on linked dependencies.
The `EXCLUDE_FROM_ALL` token, which is responsible for excluding
components from a "unspecified" installation (which we use to create
the distributed package) needs to be specified for _every_ destination
specified in an `install` call.
This commit remedies the issue of missing tokens in these calls.
CMake seems to set either `CMAKE_OSX_ARCHITECTURES` and
`CMAKE_OSX_DEPLOYMENT_TARGET` implicitly to empty cache variables when
not defined explicitly on the commandline or via a GUI.
Setting a default thus requires the `FORCE` flag to overwrite these
empty defaults with our desired results. The branches ensure that user-
provided non-empty values are not overwritten as well.
- Headers are now installed per default on Linux.
- `obs-hevc.h` is not installed if HEVC is disabled.
- OS exclusive headers are no longer installed on the wrong OS.