-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Warning flags are getting propagated #1825
Comments
I think making it private would cause warnings for users of spdlog through include, but not sure. |
@gabime I didn't understand, are you saying about spdlog_header_only? |
No. About users getting the warnings after including spdlog.h if the warning suppression is made private |
ya, it will, but it also prevents in their codebase also. Which is a risk for them. As this warning suppression is not just for spdlog if it is public. |
I dont see an easy solution for this. If the made private there will be complains about new warnings that suddenly appear. |
If not private can we do something like this: |
I think we can add an option when the "compiler is MSVC, not CUDA". target_compile_options(${project_name} INTERFACE
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<CXX_COMPILER_ID:NVIDIA>>>:/wd4251 /wd4275>)
|
this wouldn't work I think as CMAKE_ _COMPILER_ID cant be multiple values |
set(PROJECT_WARNINGS /wd4251 /wd4275)
target_compile_options(spdlog PUBLIC $<AND:$<CXX_COMPILER_ID:MSVC>,
$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:${PROJECT_WARNINGS}> ) I think this is a more elegant solution, "compiler is MSVC and language is not CUDA" |
@gabime any comment on this? |
If this fixes your problem, please issue a pr. |
@gabime when should i expect this fix to reflect in vcpkg |
We do not maintain vcpkg. |
The shared library of spdlog is propagating MSVC warning flags, which is creating issues while compiling my CUDA based application as NVCC don't play well with MSVC warning flags.
So, can we make this PRIVATE
spdlog/CMakeLists.txt
Lines 134 to 136 in ff6e3c9
Environment
OS: Windows
Compiler: MSVC(14.28.29333), NVCC 11.2
To Reproduce
link with CUDA based application using vcpkg
Expected behavior
the warning should not propagate from spdlog
The text was updated successfully, but these errors were encountered: