@@ -180,7 +180,7 @@ function(merge_libraries TARGET)
180
180
# by merge_archives script is appended to that file.
181
181
#
182
182
183
- if (NOT MSBUILD OR NOT TYPE STREQUAL "SHARED" )
183
+ if (NOT MSVC OR NOT TYPE STREQUAL "SHARED" )
184
184
185
185
set (log_name "${TARGET} .log" )
186
186
set (log_file
@@ -194,6 +194,7 @@ function(merge_libraries TARGET)
194
194
-DTYPE=${TYPE}
195
195
-DBUILD_LOG=${log_file}.${TYPE}
196
196
-DMSBUILD=${MSBUILD}
197
+ -DMSVC=${MSVC}
197
198
-DINFO=${INFO}
198
199
-DINFO_PREFIX=${INFO_PREFIX}
199
200
-P ${LIBUTILS_BIN_DIR} /merge_archives.cmake
@@ -212,7 +213,7 @@ function(merge_libraries TARGET)
212
213
# differs for different build tools.
213
214
#
214
215
215
- if (NOT MSBUILD )
216
+ if (NOT MSVC )
216
217
217
218
# TODO: Will it work with XCode?
218
219
@@ -250,7 +251,7 @@ function(merge_libraries TARGET)
250
251
RULE_LAUNCH_LINK "${LIBUTILS_BIN_DIR} /save_linker_opts ${log_file} .SHARED "
251
252
)
252
253
253
- else (NOT MSBUILD )
254
+ else (NOT MSVC )
254
255
255
256
# TODO: macOS case
256
257
@@ -283,6 +284,13 @@ function(merge_libraries TARGET)
283
284
284
285
endif ()
285
286
287
+ if (NOT MSBUILD )
288
+ message (FATAL_ERROR
289
+ "Sorry but building static connector on Windows using MSVC toolset"
290
+ " works only with msbuild at the moment."
291
+ )
292
+ endif ()
293
+
286
294
#
287
295
# Merging into static library on Windows is done by merge_archives script
288
296
# and in this case we need the build log with dependency information.
@@ -298,6 +306,9 @@ function(merge_libraries TARGET)
298
306
299
307
add_custom_command (TARGET ${TARGET} PRE_BUILD
300
308
309
+ # TODO: This works only when the build tool is msbuild (as it uses
310
+ # msbuild cmd line options), fails with ninja for example.
311
+
301
312
COMMAND ${CMAKE_COMMAND}
302
313
--build .
303
314
--target ${TARGET} -deps
@@ -310,7 +321,7 @@ function(merge_libraries TARGET)
310
321
COMMENT "Extracting dependency info for target ${TARGET} "
311
322
)
312
323
313
- endif (NOT MSBUILD )
324
+ endif (NOT MSVC )
314
325
315
326
endfunction (merge_libraries )
316
327
0 commit comments