Commit Graph

16 Commits

Author SHA1 Message Date
tytan652
12ad59f31f cmake: Enforce -Wmaybe-uninitialized to never turn into an error 2023-05-05 16:46:59 -04:00
derrod
90b8e3585e cmake: Set C11 for CMake < 3.21 2023-04-17 14:55:44 -04:00
derrod
35d42f77d6 cmake: Set C standard to ISO C17
- 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
2023-04-08 19:30:12 -04:00
PatTheMav
349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
derrod
d2f0dfa341 cmake: Set /Brepro compiler/linker options 2023-03-07 18:13:24 -05:00
derrod
b7f6ae7d7b cmake: Enable stricter MSVC compiler options 2023-03-01 20:39:53 +01:00
tytan652
d7fade2c44 cmake: Allow disabling deprecation errors on GCC/Clang 2023-01-28 23:20:41 -08:00
tytan652
aa97b7f1f1 cmake: Add workaround for GCC 12.1.0
Freedesktop Flatpaks 22.08 provide this version of GCC.
2023-01-19 13:08:46 -05:00
tytan652
541b3292e9 cmake: Add workaround for GCC on aarch64
GCC on aarch64 seems to found type-limits issue in the code where GCC
x86_64 does not.
2023-01-19 13:08:46 -05:00
tytan652
189c6939d1 cmake: Treat warnings as errors on Clang and GCC
-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.
2023-01-19 13:08:46 -05:00
Richard Stanway
510f0116a6 cmake: Specify utf-8 for MSVC builds
If there is no BOM, MSVC defaults to the user's code page which can
result in errors if UTF-8 characters are present in the source files.
2022-11-20 17:38:23 -05:00
PatTheMav
61f862d826 cmake: Fix broken pthread detection on Windows with CMake 3.24
Workaround for CMake issue
https://gitlab.kitware.com/cmake/cmake/-/issues/23829
2022-08-08 15:50:42 -07:00
jpark37
3f86354863 cmake: Treat warnings as errors on MSVC 2022-07-18 03:52:04 -07:00
PatTheMav
aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.

By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
2022-03-26 09:44:23 -04:00
PatTheMav
c993b6059a CI: Update build scripts and Github actions workflow
Also updates main CMakeLists.txt and CMakeLists.txt for unit tests,
also adds additional build directories to .gitignore file
2022-03-16 23:13:26 +01:00
PatTheMav
df94b02075 cmake: Update CMake finders and helper modules 2022-03-16 23:11:06 +01:00