Skip to content

Commit 50e6d43

Browse files
committed
forming static re-bundling command for lib.exe
1 parent 3a3602d commit 50e6d43

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

CMakeLists.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,17 @@ function(bundle_static_library name deps)
164164
)
165165

166166
elseif (CMAKE_C_COMPILER_ID MATCHES "^MSVC$")
167-
message(STATUS "Dumping all CMAKE variables...")
168-
get_cmake_property(_variableNames VARIABLES)
169-
list (SORT _variableNames)
170-
foreach (_variableName ${_variableNames})
171-
message(STATUS "${_variableName}=${${_variableName}}")
167+
foreach(tgt IN LISTS deps)
168+
list(APPEND static_libs_full_names $<TARGET_FILE:${tgt}>)
172169
endforeach()
173170

174-
message(FATAL_ERROR "Don't know how to proceed with compiler ${CMAKE_C_COMPILER_ID}!")
171+
add_custom_command(
172+
COMMAND ${CMAKE_AR} /OUT:${tgt_full_name} ${static_libs_full_names}
173+
OUTPUT ${tgt_full_name}
174+
COMMENT "Bundling ${name}"
175+
VERBATIM
176+
COMMAND_EXPAND_LISTS
177+
)
175178
else()
176179
message(FATAL_ERROR "Unknown bundling for C compiler ${CMAKE_C_COMPILER_ID}!")
177180
endif()

0 commit comments

Comments
 (0)