facebook/folly

GenPkgConfig.cmake: file(GENERATE) failed with $<COMPILE_LANGUAGE> in fmt 11.0.0 MSVC

Od0VxibTqto6Hs opened this issue · 0 comments

fmt 11.0.0 added the CMake generator expression <$<COMPILE_LANGUAGE:CXX>:/utf-8> for MSVC in fmtlib/fmt#3995, which will cause folly to fail when generating pkgconfig file in CMakeLists.txt#L497-L502.

Problem

For fmt, it added $<$<COMPILE_LANGUAGE:CXX>:/utf-8> in 11.0.0/CMakeLists.txt#L358-L362 for MSVC AND FMT_UNICODE.

If folly upgrade dependency fmt to 11.0.0, will generate libfolly.pc.gen with Cflags: -I${includedir} $<$<COMPILE_LANGUAGE:CXX>:/utf-8> in CMakeLists.txt#L497-L502.

But file(GENERATE) context does not support $<COMPILE_LANGUAGE:...>, will failed with Evaluation file to be written multiple times with different content. See CMake #26110.

Maybe it could fixed by add conditional processing like #1433.