Skip to content

Commit

Permalink
fix: fmt workaround for pkg-config generation
Browse files Browse the repository at this point in the history
Summary:
Workaround for facebook/folly#2250.

Ideally, the code should support the generator expression, but this workaround fixes the problem for fmt.

Also, see fmtlib/fmt#4159 and microsoft/vcpkg#40944

X-link: facebook/folly#2293

Reviewed By: Gownta

Differential Revision: D62785183

Pulled By: Orvid

fbshipit-source-id: d45768f12d28f53122fdedfc396f1d27c7259d19
  • Loading branch information
aminya authored and facebook-github-bot committed Sep 30, 2024
1 parent 5a2c732 commit 2905085
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions third-party/folly/src/CMake/GenPkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ function(gen_pkgconfig_vars)
"<COMPILE_LANG_AND_ID:CUDA,NVIDIA>" "<COMPILE_LANGUAGE:CUDA>"
cflags "${cflags}"
)

endif()
# patch for fmt's generator expression
if (MSVC)
# fmt 11.0.3 and above
string(REPLACE "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>" "/utf-8" cflags "${cflags}")
# fmt 11.0.2 and below
string(REPLACE "$<$<COMPILE_LANGUAGE:CXX>:/utf-8>" "/utf-8" cflags "${cflags}")
endif()

set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE)
Expand Down

0 comments on commit 2905085

Please sign in to comment.