Skip to content

Commit 7f9fec9

Browse files
committed
Bug#36250741: Can't build static connector on Windows with VS2022
In newer versions of msbuild setting vetrbosity to q (="quiet") prevented printing the command line even though ShowCommandLine option is present.
1 parent 1bd8d46 commit 7f9fec9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cmake/libutils.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ function(merge_libraries TARGET)
311311

312312
add_custom_command(TARGET ${TARGET} PRE_BUILD
313313

314+
# Note: Remove the library produced by -deps target to ensure that
315+
# the build step below invokes the linker.
316+
#
317+
# Note: `cmake -E rm -f ...` is not supported by cmake 3.15 which is cmake
318+
# version we still need to support.
319+
320+
COMMAND ${CMAKE_COMMAND} -E remove -f $<TARGET_FILE:${TARGET}-deps>
321+
314322
# TODO: This works only when the build tool is msbuild (as it uses
315323
# msbuild cmd line options), fails with ninja for example.
316324

@@ -319,8 +327,8 @@ function(merge_libraries TARGET)
319327
--target ${TARGET}-deps
320328
--config $<CONFIG>
321329
--
322-
/nologo /v:q /filelogger /flp:Verbosity=q /flp:ShowCommandLine
323-
/flp:LogFile=\"${log_file}.STATIC\"
330+
/nologo /v:q /filelogger
331+
"/flp:Verbosity=m;ShowCommandLine;LogFile=\"${log_file}.STATIC\""
324332

325333
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
326334
COMMENT "Extracting dependency info for target ${TARGET}"

0 commit comments

Comments
 (0)