Skip to content

Added support non-MSVC toolchains on Windows (fixed #1 issue) #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
@@ -24,25 +24,28 @@ function(win_copy_deps_to_target_dir target)
set(has_runtime_dll_genex YES)

add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P "${mylib_SOURCE_DIR}/cmake/silent_copy.cmake"
COMMAND ${CMAKE_COMMAND} -P "${mylib_SOURCE_DIR}/cmake/silent_copy.cmake"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert white space changes.

"$<TARGET_RUNTIME_DLLS:${target}>" "$<TARGET_FILE_DIR:${target}>"
COMMAND_EXPAND_LISTS)
COMMAND_EXPAND_LISTS)
endif()

foreach(dep ${ARGN})
get_target_property(dep_type ${dep} TYPE)

set(pdb_files "")
if (MSVC)
set(pdb_files "$<TARGET_PDB_FILE:${dep}>")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use generator expression CXX_COMPILER_ID to get compiler in use.

endif()
if(dep_type STREQUAL "SHARED_LIBRARY")
if(NOT has_runtime_dll_genex)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P "${mylib_SOURCE_DIR}/cmake/silent_copy.cmake"
"$<TARGET_FILE:${dep}>" "$<TARGET_PDB_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>"
COMMAND_EXPAND_LISTS)
COMMAND ${CMAKE_COMMAND} -P "${mylib_SOURCE_DIR}/cmake/silent_copy.cmake"
"$<TARGET_FILE:${dep}>" "$pdb_files" "$<TARGET_FILE_DIR:${target}>"
COMMAND_EXPAND_LISTS)
else()
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P "${mylib_SOURCE_DIR}/cmake/silent_copy.cmake"
"$<TARGET_PDB_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>"
COMMAND_EXPAND_LISTS)
COMMAND ${CMAKE_COMMAND} -P "${mylib_SOURCE_DIR}/cmake/silent_copy.cmake"
"$pdb_files" "$<TARGET_FILE_DIR:${target}>"
COMMAND_EXPAND_LISTS)
endif()
endif()
endforeach()