fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
19.84k stars 2.42k forks source link

Added generator expression to /utf-8 compile option #3995

Closed ChristianGebhardt closed 3 weeks ago

ChristianGebhardt commented 1 month ago

Do not pass the compile options in the project to other compilers such as nvcc

When using the library within a project with multiple compilers, the compiler option should only be passed to the msvc compiler.

vitaut commented 4 weeks ago

Thanks for the PR. I wonder how this solves the problem for nvcc? Wouldn't COMPILE_LANGUAGE:CXX options apply to it as well?

ChristianGebhardt commented 3 weeks ago

Thanks for looking into it! For CUDA code, you would specify $<COMPILE_LANGUAGE:CUDA>. So, it indeed differentiates between them and ignores the compile option for CUDA (or also other languages like C# or C within the project).

Please, also checkout the supported languages for reference: https://cmake.org/cmake/help/latest/command/enable_language.html

vitaut commented 3 weeks ago

Merged, thanks!