mirror of
https://github.com/reactos/reactos.git
synced 2025-07-08 07:27:55 +00:00
[CMAKE]
* Add delay importlib creation support. svn path=/trunk/; revision=52178
This commit is contained in:
parent
ba1ef490f1
commit
58fca73e26
2 changed files with 29 additions and 0 deletions
|
@ -230,6 +230,14 @@ macro(add_importlibs MODULE)
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(add_delay_importlibs MODULE)
|
||||||
|
foreach(LIB ${ARGN})
|
||||||
|
target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/importlibs/lib${LIB}_delayed.a)
|
||||||
|
add_dependencies(${MODULE} lib${LIB}_delayed)
|
||||||
|
endforeach()
|
||||||
|
target_link_libraries(${MODULE} delayimp)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
if(NOT ARCH MATCHES i386)
|
if(NOT ARCH MATCHES i386)
|
||||||
set(DECO_OPTION "-@")
|
set(DECO_OPTION "-@")
|
||||||
endif()
|
endif()
|
||||||
|
@ -250,25 +258,42 @@ macro(add_importlib_target _exports_file)
|
||||||
|
|
||||||
if (${_extension} STREQUAL ".spec")
|
if (${_extension} STREQUAL ".spec")
|
||||||
|
|
||||||
|
# Normal importlib creation
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||||
COMMAND native-spec2def -n=${_name}${_suffix} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
|
COMMAND native-spec2def -n=${_name}${_suffix} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
|
||||||
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||||
|
|
||||||
|
# Delayed importlib creation
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_delayed.a
|
||||||
|
COMMAND native-spec2def -n=${_name}${_suffix} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}_delayed_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
|
||||||
|
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}_delayed_implib.def --kill-at --output-delaylib ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_delayed.a
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||||
|
|
||||||
elseif(${_extension} STREQUAL ".def")
|
elseif(${_extension} STREQUAL ".def")
|
||||||
message("Use of def files for import libs is deprecated: ${_exports_file}")
|
message("Use of def files for import libs is deprecated: ${_exports_file}")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||||
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_delayed.a
|
||||||
|
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} --kill-at --output-delaylib ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_delayed.a
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported exports file extension: ${_extension}")
|
message(FATAL_ERROR "Unsupported exports file extension: ${_extension}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Normal importlib target
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
lib${_name}
|
lib${_name}
|
||||||
DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a)
|
DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a)
|
||||||
|
# Delayed importlib target
|
||||||
|
add_custom_target(
|
||||||
|
lib${_name}_delayed
|
||||||
|
DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_delayed.a)
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
|
@ -173,6 +173,10 @@ macro(add_importlibs MODULE)
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(add_delay_importlibs MODULE)
|
||||||
|
# TODO
|
||||||
|
endmacro()
|
||||||
|
|
||||||
macro(spec2def _dllname _spec_file)
|
macro(spec2def _dllname _spec_file)
|
||||||
get_filename_component(_file ${_spec_file} NAME_WE)
|
get_filename_component(_file ${_spec_file} NAME_WE)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue