mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Replace forward slashes by backslashes in BMI path for MSVC. (#4344)
* Fix slashes in BMI path for MSVC builds * Fix BMI path for MSVC builds when building with Ninja generator
This commit is contained in:
@ -27,7 +27,13 @@ endfunction()
|
|||||||
# DEPRECATED! Should be merged into add_module_library.
|
# DEPRECATED! Should be merged into add_module_library.
|
||||||
function(enable_module target)
|
function(enable_module target)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(BMI ${CMAKE_CURRENT_BINARY_DIR}/${target}.ifc)
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||||
|
# Ninja dyndep expects the .ifc output to be located in a specific relative path
|
||||||
|
file(RELATIVE_PATH BMI_DIR "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir")
|
||||||
|
else()
|
||||||
|
set(BMI_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
endif()
|
||||||
|
file(TO_NATIVE_PATH "${BMI_DIR}/${target}.ifc" BMI)
|
||||||
target_compile_options(${target}
|
target_compile_options(${target}
|
||||||
PRIVATE /interface /ifcOutput ${BMI}
|
PRIVATE /interface /ifcOutput ${BMI}
|
||||||
INTERFACE /reference fmt=${BMI})
|
INTERFACE /reference fmt=${BMI})
|
||||||
|
Reference in New Issue
Block a user