Commit Graph

47 Commits

Author SHA1 Message Date
Rémi Denis-Courmont 38c1029176 stdckdint: add compatibility header
This only implements unsigned types for now, as there are no known use
cases for signed checked arithmetic as of yet. The macros will safely
error out at compilation time if signed types are misused.
2024-02-20 19:34:53 +00:00
Fatih Uzunoglu 4baa098d90 raise minimum required mingw64 version from 5.0 to 6.0
DirectX 12 sdk provided by MinGW 8.0.1 is required for Qt 6,
and patching MinGW 5.0 to include d3d12 sdk requires sheer
amount of effort.
2024-02-15 12:15:23 +00:00
Steve Lhomme b164a2f4b9 switch to C17 2024-02-06 08:32:48 +00:00
Steve Lhomme 5dcc5ff839 switch C++ support to C++17
As contribs keep being updated with newer versions of the language, we need to
support a more modern version of C++ going forward.

Setting -std=c++17 should not break existing contribs that are built with C++11 or C++14.
In fact we already support the mix of versions between 11 and 14 without problem.
Modern C++ compilers are designed to take care of this [1].
When switching to a new C++ version there might however be some slight differences on how the
code is interpreted. These differences [2] might trigger some build errors for removed parts.

[1] https://stackoverflow.com/questions/46746878/is-it-safe-to-link-c17-c14-and-c11-objects
[2] https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0636r3.html
2024-01-26 10:42:23 +00:00
Alexandre Janniaux ee393c1457 meson: generalize test infrastructure
By moving vlc_tests array declaration from test/meson.build to the root
folder, we can create tests from anywhere in the code base.
2024-01-22 17:37:31 +00:00
Steve Lhomme c1de7653ab meson: fix adding compat/stdbit to the include path
We can generate the vlc_include_dirs later, it's only used later in the
meson file.
2024-01-09 11:37:36 +00:00
Steve Lhomme 364543f441 meson: expose fallback <stdbit.h> if absent
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-01-06 13:23:18 +00:00
Steve Lhomme 6aadea3959 build: add -Werror=format error
GCC and Clang can check that the % format strings are used with the proper
types. If they are not that can lead to security issues.

This cannot be added to global CFLAGS as it will issue an error when testing
for asprintf/vasprintf in AC_REPLACE_FUNCS().
2023-11-10 04:51:50 +00:00
Steve Lhomme 8f3d984910 meson: add extra_checks do add more compilation errors
These are the same options we already use in build scripts.
2023-11-10 04:51:50 +00:00
Sean McGovern ba02c9b5ac meson.build: test for the presence of <sys/auxv.h> 2023-09-29 05:16:58 +00:00
Alexandre Janniaux 7c4ed8b6e0 meson.build: add new libgcrypt dependency
The libgcrypt dependency can be found directly from meson since the
version 49.0[^changelog] and it will use either pkg-config or
libgcrypt-config directly.

The libgcrypt dependency is needed for the update mechanism in src/ and
for the src_crypto_update test.

[^changelog]: https://mesonbuild.com/Release-notes-for-0-49-0.html#libgcrypt-dependency-now-supports-libgcryptconfig
2023-08-06 12:33:55 +00:00
Alexandre Janniaux 653cec766c test/libvlc: meson.build: add basic tests for libvlc
Add the tests that are not depending on some libvlc plugins, ie. those
that can be run immediately with `meson test` without compiling the
sources first. It makes use of the test infrastructure from the previous
commits.

The test libvlc_media_list_player is commented out like in Makefile.am
since the future refactor of the libvlc API will re-enable it.
2023-08-03 08:01:09 +00:00
Loïc Branstett e80595b5f5 meson: add rust (-Drust=enabled) option
This adds a -Drust feature option to the meson build system, which aims
to enable pure Rust modules.

This option will check for the presence of cargo (Rust package manager
and build system) and give a warning about the experimental nature of
the Rust modules.

This option is disabled by default.
2023-07-13 13:47:03 +00:00
Steve Lhomme 85344d0cb0 meson: detect zlib as a dependency
The pkg-config or cmake exports should be present.
It will also give us the proper include folder and defines.
2023-07-04 12:39:13 +00:00
Steve Lhomme d467e95c65 do not use the WINSTORECOMPAT define for VLC sources
We don't need this hack anymore. We call the proper API's available in
UWP when needed.

However we still need to link with windowsappcompat as libunwind is calling
RtlRestoreContext(), regardless if we're building for UWP or not.
2023-05-27 06:17:11 +00:00
Steve Lhomme 9e2cb735a4 remove VLC_WINSTORE_APP define
It's not used anymore. We can detect locally what is available or not.
We only need to know in make files how to link in the case.
2023-05-22 07:14:29 +00:00
Marvin Scholz e8b6a9324d meson: add gettext support
While runtime gettext support was already working,
this adds the missing piece of build integrations.

With these changes, three new targets are now available
to manage translation files:

- vlc-pot: Regenerates the .pot files using xgettext
- vlc-update-po: Regenerates the .po files from the current .pot files
- vlc-gmo: Builds (but not installs) the translations
2023-04-02 08:37:15 +00:00
Steve Lhomme cedea4d018 configure: don't the check presence of stricmp
_stricmp a Windows thing that is present in all the CRT, even in UCRT.
The stricmp() deprecated variant doesn't seem to exist elsewhere.

In some configuration it's not possible to link with stricmp() even though
_stricmp() is available.
2023-02-28 10:10:27 +00:00
Pierre Lamot f8cd81e4f5 meson: fix dcomp.h detection
dcomp.h is not a valid C header
2023-02-28 09:39:43 +00:00
Steve Lhomme 8c46cfc25b meson: define X_DISPLAY_MISSING once
disabler() also supports found() and will return false.
2023-02-10 06:30:25 +00:00
Alexandre Janniaux df17310398 meson.build: set macosx option on OSX only 2023-02-06 21:14:23 +00:00
Steve Lhomme 42d230befa configure: don't define _POSIX_C_SOURCE for mingw-w64
It forces __USE_MINGW_ANSI_STDIO, M_PI and some functions we already have
done better in compat.
2023-01-31 09:11:53 +00:00
Steve Lhomme a7b55fa70f configure: don't define _POSIX_SOURCE for mingw-w64
It forces __USE_MINGW_ANSI_STDIO, M_PI and some functions we already have
done better in compat.
2023-01-31 09:11:53 +00:00
Steve Lhomme dddae21848 configure: detect asprintf/vasprintf the standard way
The mingw-w64 variant is equivalent to ours. No need to do a special case.
These are GNU functions, not C11 or POSIX functions.
2023-01-31 09:11:53 +00:00
Steve Lhomme 6b1f7dc265 meson: add stack protection option 2023-01-31 08:53:16 +00:00
Johannes Kauffmann 33fdb81100 meson: check for -Wl,-Bsymbolic 2023-01-30 07:11:43 +00:00
Steve Lhomme 8ef232fc81 meson: only enable __USE_MINGW_ANSI_STDIO for non-UCRT builds
Similar to configure.ac
2023-01-29 16:26:06 +00:00
Steve Lhomme a98a501df0 meson: fix PROCESS_MITIGATION_IMAGE_LOAD_POLICY check 2023-01-26 11:23:56 +00:00
Johannes Kauffmann 8b90010a5d meson: force -fno-strict-aliasing for C++ modules
Following 7a776a79ff.

Mirroring configure.ac, this check is only done for MinGW, because it
doesn't make sense on MSVC.
2023-01-24 14:02:56 +00:00
Steve Lhomme d7a9bc2326 meson: remove _ISOCXX_SOURCE macros on Windows
With a proper C11 compiler we don't need this. Either they activate C11
things in the compiler which should be there anyway. Or in the SDK
which is __USE_MINGW_ANSI_STDIO for C99 and nothing else.
2023-01-23 07:27:12 +00:00
Steve Lhomme 7e388405f4 meson: remove unneeded windows defines
They are used to enable _USE_MATH_DEFINES or __USE_MINGW_ANSI_STDIO, which we
already define.
2023-01-23 07:27:12 +00:00
Steve Lhomme 6be0e8af6b configure: remove static_assert check
We require C11 support where it's mandatory. Plus we use it later to check
for some function support.
2023-01-20 08:31:24 +00:00
Steve Lhomme ea876bf896 configure: detect gmtime_r/localtime_r the standard way
The mingw-w64 variants doesn't set the errno, so use our compat version.
2023-01-20 07:17:07 +00:00
Steve Lhomme 5b398308b6 meson: add common compiler options similar to configure.ac
Co-authored-by: Marvin Scholz <epirat07@gmail.com>
2023-01-18 12:16:33 +00:00
Steve Lhomme 455b4ffbe0 meson: simplify choice of compiler flag to use 2023-01-18 12:16:33 +00:00
Johannes Kauffmann c91fac9b59 meson: fix dict key/value style
As per the style guide.
2023-01-15 09:26:33 +00:00
Johannes Kauffmann f242e3c7eb meson: fix named argument style
As per the style guide.
2023-01-15 09:26:33 +00:00
Johannes Kauffmann a01c567bff meson: add initial winstore support
This patch tries to replicate configure.ac (at the time of writing)
from line 407 - 438, except the strict aliasing check. Libraries such as
ole32 are linked by default by meson, so those have been omitted.
Another difference: the check has been moved out of the mingw check.

This is not meant to be functional just yet, but having the winstore
option gives a starting point for further support.
2023-01-14 14:03:40 +00:00
Steve Lhomme 79f063df81 configure: only use sdkddkver.h to test the default _WIN32_WINNT
It's supported on all mingw-w64 versions we support. We don't need the
whole windows.h for that.
2023-01-13 14:35:04 +00:00
Steve Lhomme 5b27a78738 meson: only set _WIN32_WINNT if it's not set in the environment
The same way it's done in configure.ac
2023-01-13 14:35:04 +00:00
Steve Lhomme 6424f5452e meson: enable error on missing function declaration
This is also enabled in configure.ac.
2023-01-11 07:57:22 +00:00
Steve Lhomme 90efc05040 meson: add specific folder for missing includes in the Windows SDK 2023-01-11 07:57:22 +00:00
Steve Lhomme 0a5f544457 meson: fix header used to test functions on Windows
The proper definitions are not found in unistd.h.
It works both for the Windows SDK and mingw-w64.
2023-01-10 14:32:06 +00:00
Steve Lhomme ae3e820453 meson: fix iphlpapi.h tests
windows.h needs to be included before otherwise some defines are missing
2023-01-10 14:32:06 +00:00
Steve Lhomme e28d3cb33c meson: remove duplicate checks 2023-01-10 14:32:06 +00:00
Steve Lhomme e030e04e5d meson: define missing ssize_t and SSIZE_MAX from ptrdiff_t
ptrdiff_t is available in C11
2023-01-07 20:39:45 +00:00
Marvin Scholz d5f07af209 meson: add initial meson build system
Co-authored-by: Tanguy Dubroca <tanguy.dubroca@lse.epita.fr>
Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Co-authored-by: Alexandre Janniaux <ajanni@videolabs.io>
2023-01-04 14:48:39 +00:00