Skip to content

Commit

Permalink
Make multi-config check dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Twon committed Nov 1, 2024
1 parent 7509ac7 commit 330431c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,15 @@ function(targets_get_translation_units)
list(APPEND targetTranslationUnits ${filteredTargetSource})
endforeach()

get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
get_target_property(targetBinaryDir ${ARGS_TARGET} BINARY_DIR)
foreach(file IN LISTS targetTranslationUnits)
targets_relative_path_of_source(TARGET_NAME ${ARGS_TARGET} RESULT file SOURCE_FILE ${file})
set(translationUnitLocation "${targetBinaryDir}/CMakeFiles/${ARGS_TARGET}.dir/$<$<BOOL:CMAKE_CONFIGURATION_TYPES>:$<CONFIG>/>${file}")
if(IS_MULTI_CONFIG)
set(translationUnitLocation "${targetBinaryDir}/CMakeFiles/${ARGS_TARGET}.dir/$<CONFIG>/${file}")
else()
set(translationUnitLocation "${targetBinaryDir}/CMakeFiles/${ARGS_TARGET}.dir/${file}")
endif()
list(APPEND targetTranslationUnitLocations ${translationUnitLocation})
endforeach()

Expand Down

0 comments on commit 330431c

Please sign in to comment.