endif()
endfunction()
-function(add_delay_importlibs MODULE)
+function(add_delay_importlibs _module)
+ get_target_property(_module_type ${_module} TYPE)
+ if(_module_type STREQUAL "STATIC_LIBRARY")
+ message(FATAL_ERROR "Cannot add delay imports to a static library")
+ endif()
foreach(LIB ${ARGN})
- target_link_libraries(${MODULE} lib${LIB}_delayed)
+ target_link_libraries(${_module} lib${LIB}_delayed)
endforeach()
- target_link_libraries(${MODULE} delayimp)
+ target_link_libraries(${_module} delayimp)
endfunction()
if(NOT ARCH STREQUAL "i386")
#define those for having real libraries
set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO <LINK_FLAGS> /OUT:<TARGET> <OBJECTS>")
set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /Cp /Fo<OBJECT> /c /Ta <SOURCE>")
-macro(add_delay_importlibs MODULE)
+function(add_delay_importlibs _module)
+ get_target_property(_module_type ${_module} TYPE)
+ if(_module_type STREQUAL "STATIC_LIBRARY")
+ message(FATAL_ERROR "Cannot add delay imports to a static library")
+ endif()
foreach(LIB ${ARGN})
- add_target_link_flags(${MODULE} "/DELAYLOAD:${LIB}.dll")
- target_link_libraries(${MODULE} lib${LIB})
+ add_target_link_flags(${_module} "/DELAYLOAD:${LIB}.dll")
+ target_link_libraries(${_module} lib${LIB})
endforeach()
- target_link_libraries(${MODULE} delayimp)
-endmacro()
+ target_link_libraries(${_module} delayimp)
+endfunction()
function(generate_import_lib _libname _dllname _spec_file)