-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass cli CMAKE_CXX_FLAGS(_XXX) and improve SoundTouch linking #420
base: master
Are you sure you want to change the base?
Conversation
I'm confused about the ClangCL comment. That section of CMakeLists.txt hasn't changed in 5 years and I just tested on W10, W11, VS2019, and VS2022, and |
Are you using recent clang 19.1.x? IIRC the issue raised when I updated it. These patches are from ~2 weeks ago when I build avs+ - I have to check again what was the exact issue. |
The VS2019 check on Win10 was using Clang 12, and VS2022 is using Clang 18.1.8 (I ran the updater first just to make sure). The only 19.x version I have is the llvm-mingw installation on my main Linux setup, and it doesn't have the CL interface with it due to a lack of the MS SDK stuff that would require. |
Yes, I don't use clang shipped with VS (same with cmake and other stuff). I use these scripts (with some changes) to implement the clang support in VS and the builds from llvm. |
Regarding the exception handling cl parameters, I found this conversation, which mentions something that is available only since v19: I see that there was some incompatibility between MSVC and clang-cl, I haven't installed clang 19.1 yet, actually what was the problem? |
Attached the logs from 19.1.0 and 19.1.6. Edit: The issue is not related to the exceptions. If you pass |
Anyway, |
From what I've gleaned elseweb, the defaults for MSVC are (were?) different depending on if you used the GUI or the CLI, and - it was probably NMake - the CLI would just spam warnings about the exception handling model into the Prompt. This would have been years ago, so the behavior could very well have changed since the main compiler in use for the core was VS 2010 (or 2013). I remember the warnings, and the comments where it does the override mention the warnings, but I'm not sure if the 'differing defaults' explanation actually was ever true, or if it was, if it still does that with VS 2019 or 2022. Maybe since it did definitely affect NMake, it would also affect using MSVC+Ninja, but I don't know. It was long before we ever supported Clang, and the rules likely were just copy/pasted to apply to that case when ClangCL was added to the detection. |
Pass cli CMAKE_CXX_FLAGS(_XXX). Remove CMAKE_XXX_FLAGS_RELEASE flags - they are implied with /O2 (except /GS-).
Looking good, but let's wait for qyot27. |
Link SoundTouch even if pkg_config isn't available (mainly on Windows). Use `-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=path_soundtouch_headers and `-DCMAKE_PREFIX_PATH=path_soundtouch_lib`.
Thanks. There was also soundtorch in the commit message. |
Sorry, I'm just putting this ito the discussion, I'm using cmake gui, and CMAKE_PREFIX_PATH is not set, must be added manually after in each platform change and cache deletion. I was trying this addition in the main CMakeLists.txt.
|
IMO, adhering a CMakeLists.txt option too closely to a build guide is fairly risky. But since we currently do similar enough assumptions for, example, the baseclasses for DirectShowSource, guarding it to detect whether someone is following the guide is probably fine. In the short term, one of those reasons I consider it risky is because I've been weighing the Windows on ARM stuff and unless there's a really good reason not to, putting in a hard¹ restriction that MSVC and MSVC-like compilers can only be used on x86(-64). Which in turn means the ARM64 instructions in the guide will need to be split out and rewritten/adapted for MinGW under [WSL2|MSYS2], at least if we want to be consistent. ¹meaning that both CMakeLists.txt prevents that combination and that the config parameters and macros do as well, to try and actively stop it from being built that way. There are like, three different options for how to proceed on Windows-on-ARM, and none of them are optimal (two are merely decent, with one being riskier than the other depending on the point of view, and one is horrible and just continues perpetuating the problems that currently exist). A future solution with regard to having the external dependencies build guide being followed or expected in CMakeLists.txt would be to have a second repository with a CMake project that fetches and builds/organizes SoundTouch and DevIL in the way we expect them to, or even go as far as having it build the core at the end too. Similar in spirit to mpv-winbuild-cmake, except significantly smaller in scope. One could argue: "at that point, why not still have it inside the AviSynthPlus repo as submodules?", but that would require us continuing to have that logic inside the core's build system, not to mention that submodules are tied to specific commits and we'd be right back to having to try to keep the dependencies up-to-date in the core's settings instead of just pointing at the ones already installed. |
You are right, this is a very specific modification. Not elegant. Anyway, |
Probably you know but you can do in cli IMO this should be changed to |
No description provided.