https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b494abbd721bed2da579c…
commit b494abbd721bed2da579c80b0b30782686fcc751
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Sep 5 21:59:16 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Fri Oct 12 19:30:36 2018 +0200
[SDK] Add version option to our spec2def cmake command
---
sdk/cmake/gcc.cmake | 8 ++++++--
sdk/cmake/msvc.cmake | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index d54fc3a93e..ae4056b21b 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -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)
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index 8d2c8cebc3..95a0c252b9 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -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)