File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -395,12 +395,25 @@ set(riscv_generated_files)
395395
396396function (copy_header_to_output_dir src_dir file)
397397 set (src ${src_dir} /${file} )
398- set (dst ${output_dir} /${file} )
399- add_custom_command (OUTPUT ${dst}
400- DEPENDS ${src}
401- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
402- COMMENT "Copying clang's ${file} ..." )
403- list (APPEND out_files ${dst} )
398+ if ("${CMAKE_CFG_INTDIR} " STREQUAL "." )
399+ set (dst ${output_dir} /${file} )
400+ add_custom_command (OUTPUT ${dst}
401+ DEPENDS ${src}
402+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
403+ COMMENT "Copying clang's ${file} ..." )
404+ list (APPEND out_files ${dst} )
405+ else ()
406+ foreach (BUILD_MODE ${CMAKE_CONFIGURATION_TYPES} )
407+ # Replace the special string with a per config directory.
408+ string (REPLACE ${CMAKE_CFG_INTDIR} ${BUILD_MODE} per_conf_output_dir ${output_dir} )
409+ set (dst ${per_conf_output_dir} /${file} )
410+ add_custom_command (OUTPUT ${dst}
411+ DEPENDS ${src}
412+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
413+ COMMENT "Copying clang's ${file} ..." )
414+ list (APPEND out_files ${dst} )
415+ endforeach ()
416+ endif ()
404417 set (out_files ${out_files} PARENT_SCOPE)
405418endfunction (copy_header_to_output_dir)
406419
You can’t perform that action at this time.
0 commit comments