[CMAKE]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 27 Jan 2011 21:50:54 +0000 (21:50 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 27 Jan 2011 21:50:54 +0000 (21:50 +0000)
get the library suffix from the target instead of passing it to the macro.

svn path=/branches/cmake-bringup/; revision=50519

gcc.cmake
msc.cmake

index e32d6af..621aad3 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -268,21 +268,18 @@ macro(add_importlib_target _exports_file)
 
     get_filename_component(_name ${_exports_file} NAME_WE)
     get_filename_component(_extension ${_exports_file} EXT)
+    get_target_property(_suffix ${_name} SUFFIX)
 
     if (${_extension} STREQUAL ".spec")
-        if (${ARGC} GREATER 1)
-            set(DLLNAME_OPTION "-n=${ARGV1}")
-        else()
-            set(DLLNAME_OPTION "")
-        endif()
 
         add_custom_command(
             OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
-            COMMAND native-spec2def ${DLLNAME_OPTION} -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
             DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
 
     elseif(${_extension} STREQUAL ".def")
+        message("Use of def files for import libs is deprecated: ${_exports_file}")
         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
index a6abdf6..c7e2d9f 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -138,11 +138,12 @@ endmacro()
 # Thanks MS for creating a stupid linker\r
 macro(add_importlib_target _exports_file)\r
     get_filename_component(_name ${_exports_file} NAME_WE)\r
+    get_target_property(_suffix ${_name} SUFFIX)\r
 \r
     # Generate the asm stub file and the export def file\r
     add_custom_command(\r
         OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def\r
-        COMMAND native-spec2def --ms --kill-at -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}\r
+        COMMAND native-spec2def --ms --kill-at -r -n=${_name}.${_suffix} -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}\r
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})\r
 \r
     # Assemble the stub file\r