aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/electronicarts.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2025-07-20 15:26:17 +0200
committerKacper Michajłow <kasper93@gmail.com>2025-08-05 18:31:05 +0200
commitbc012ac9187b00fa8ea0e1d000ceff684775d5ee (patch)
tree852828d6cacec3d88001ad3fb209639c55b6d7b0 /libavformat/electronicarts.c
parent50408c55ac4c1f56c9e90d120bbc6cfc6034351a (diff)
downloadffmpeg-master.tar.gz
configure: treat unrecognized flags as errors on MSVCHEADmaster
This is important for feature checking to work correctly. It can happen that an unrecognized flag passes the compile test with only a warning, while failing in preprocessor-only check with an error. This causes all test_cpp calls to fail and silently produces arguably broken MSVC builds. Also, all check_* functions don't work as expected, because they assume the check passed, even though there was a warning. Additionally, this brings the behavior in line with GCC/Clang based builds, failing early on unrecognized flags instead of silently continuing with warnings in the log. The /options:strict option is available starting in Visual Studio 2022 version 17.0. Because of that, we cannot use check_cflags alone, as it would add this flag for older MSVC versions and produce warnings. So, we need to manually perform a version check. A bit of a chicken and egg problem. Perform the version check before adding extra flags from the user to ensure we don't silently fail the preprocessor check due to invalid flags on older MSVC versions. Note that behavior differs depending on whether we are compiling or only preprocessing. This fixes silent different between handling: `cl.exe -P foo c.c` c1: fatal error C1083: Cannot open source file: 'foo': No such file or directory `cl.exe -c foo c.c` cl : Command line warning D9024 : unrecognized source file type 'foo', object file assumed Where -P fails, while -c throws warnings only. Of course `foo` is completely bogus here, but depends on the flags or configuration this may be unsupported argument. Or even some converted path from MSYS when run inside it. The objective is to always error out instead of silently hiding this. Use check_cflags even after the _MSC_FULL_VER check, for non-MSVC compilers. For example Clang-CL impersonate MSVC, but does not support -options:strict flag currently. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Diffstat (limited to 'libavformat/electronicarts.c')
0 files changed, 0 insertions, 0 deletions