mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:15:59 +00:00
[CMAKE]
- Add rostests to build when the folder exists. - Alter the importlib target macro to handle definition files along with spec files. svn path=/branches/cmake-bringup/; revision=50101
This commit is contained in:
parent
88a37f9ee8
commit
bec9e0bfa6
4 changed files with 33 additions and 14 deletions
|
@ -142,6 +142,7 @@ add_subdirectory(drivers)
|
|||
add_subdirectory(hal)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(media)
|
||||
add_subdirectory(modules)
|
||||
add_subdirectory(ntoskrnl)
|
||||
add_subdirectory(subsystems)
|
||||
|
||||
|
|
34
gcc.cmake
34
gcc.cmake
|
@ -192,23 +192,37 @@ macro(add_importlibs MODULE)
|
|||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(add_importlib_target _spec_file)
|
||||
get_filename_component(_name ${_spec_file} NAME_WE)
|
||||
macro(add_importlib_target _exports_file)
|
||||
|
||||
get_filename_component(_name ${_exports_file} NAME_WE)
|
||||
get_filename_component(_extension ${_exports_file} EXT)
|
||||
|
||||
if (${_extension} STREQUAL ".spec")
|
||||
if (${ARGC} GREATER 1)
|
||||
set(DLLNAME_OPTION "-n=${ARGV1}")
|
||||
else()
|
||||
set(DLLNAME_OPTION "")
|
||||
endif()
|
||||
|
||||
if (${ARGC} GREATER 1)
|
||||
set(DLLNAME_OPTION "-n=${ARGV1}")
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||
COMMAND native-spec2def ${DLLNAME_OPTION} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
|
||||
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||
|
||||
elseif(${_extension} STREQUAL ".def")
|
||||
add_custom_command(
|
||||
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
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||
else()
|
||||
set(DLLNAME_OPTION "")
|
||||
message(FATAL_ERROR "Unsupported exports file extension: ${_extension}")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||
COMMAND native-spec2def ${DLLNAME_OPTION} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}.def ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
||||
COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
|
||||
add_custom_target(
|
||||
lib${_name}
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a)
|
||||
|
||||
endmacro()
|
||||
|
||||
macro(spec2def _dllname _spec_file)
|
||||
|
|
4
modules/CMakeLists.txt
Normal file
4
modules/CMakeLists.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rostests/)
|
||||
add_subdirectory(rostests)
|
||||
endif()
|
|
@ -139,14 +139,14 @@ set(IDL_PROXY_ARG /proxy)
|
|||
set(IDL_DLLDATA_ARG /dlldata )
|
||||
|
||||
# Thanks MS for creating a stupid linker
|
||||
macro(add_importlib_target _spec_file)
|
||||
get_filename_component(_name ${_spec_file} NAME_WE)
|
||||
macro(add_importlib_target _exports_file)
|
||||
get_filename_component(_name ${_exports_file} NAME_WE)
|
||||
|
||||
# Generate the asm stub file and the export def file
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def
|
||||
COMMAND native-spec2def -@ -r -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
|
||||
COMMAND native-spec2def -@ -r -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
|
||||
|
||||
# Assemble the stub file
|
||||
add_custom_command(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue