mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[SDK] Add version option to our spec2def cmake command
This commit is contained in:
@@ -358,7 +358,7 @@ set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def <OBJECTS> --kill-
|
||||
set(CMAKE_IMPLIB_DELAYED_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def <OBJECTS> --kill-at --output-delaylib=<TARGET>")
|
||||
function(spec2def _dllname _spec_file)
|
||||
|
||||
cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;NO_PRIVATE_WARNINGS;WITH_RELAY" "" "" ${ARGN})
|
||||
cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;NO_PRIVATE_WARNINGS;WITH_RELAY" "VERSION" "" ${ARGN})
|
||||
|
||||
# Get library basename
|
||||
get_filename_component(_file ${_dllname} NAME_WE)
|
||||
@@ -372,10 +372,14 @@ function(spec2def _dllname _spec_file)
|
||||
set(__with_relay_arg "--with-tracing")
|
||||
endif()
|
||||
|
||||
if(__spec2def_VERSION)
|
||||
set(__version_arg "--version=0x${__spec2def_VERSION}")
|
||||
endif()
|
||||
|
||||
# Generate exports def and C stubs file for the DLL
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c
|
||||
COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
||||
COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def)
|
||||
|
||||
if(__spec2def_ADD_IMPORTLIB)
|
||||
|
||||
@@ -401,7 +401,7 @@ else()
|
||||
endif()
|
||||
function(spec2def _dllname _spec_file)
|
||||
|
||||
cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;NO_PRIVATE_WARNINGS;WITH_RELAY" "" "" ${ARGN})
|
||||
cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;NO_PRIVATE_WARNINGS;WITH_RELAY" "VERSION" "" ${ARGN})
|
||||
|
||||
# Get library basename
|
||||
get_filename_component(_file ${_dllname} NAME_WE)
|
||||
@@ -415,10 +415,14 @@ function(spec2def _dllname _spec_file)
|
||||
set(__with_relay_arg "--with-tracing")
|
||||
endif()
|
||||
|
||||
if(__spec2def_VERSION)
|
||||
set(__version_arg "--version=0x${__spec2def_VERSION}")
|
||||
endif()
|
||||
|
||||
# Generate exports def and C stubs file for the DLL
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c
|
||||
COMMAND native-spec2def --ms -a=${SPEC2DEF_ARCH} -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
||||
COMMAND native-spec2def --ms -a=${SPEC2DEF_ARCH} -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def)
|
||||
|
||||
if(__spec2def_ADD_IMPORTLIB)
|
||||
|
||||
Reference in New Issue
Block a user