Skip to content

Commit

Permalink
fix: fmt workaround for pkg-config generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 16, 2024
1 parent 8a5e31a commit c025886
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 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 c025886

Please sign in to comment.