[ros-diffs] [jgardou] 52468: [CMAKE] - add back add_importlib_target for def files, w32kdll relies on it.

jgardou at svn.reactos.org jgardou at svn.reactos.org
Sun Jun 26 10:21:57 UTC 2011


Author: jgardou
Date: Sun Jun 26 10:21:57 2011
New Revision: 52468

URL: http://svn.reactos.org/svn/reactos?rev=52468&view=rev
Log:
[CMAKE]
  - add back add_importlib_target for def files, w32kdll relies on it.

Modified:
    trunk/reactos/cmake/gcc.cmake

Modified: trunk/reactos/cmake/gcc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=52468&r1=52467&r2=52468&view=diff
==============================================================================
--- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Sun Jun 26 10:21:57 2011
@@ -221,17 +221,17 @@
 
 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(${_suffix} STREQUAL "_suffix-NOTFOUND")
-        # get_target_property(_type ${_name} TYPE)
-        # if(${_type} MATCHES EXECUTABLE)
-            # set(_suffix ".exe")
-        # else()
-            # set(_suffix ".dll")
-        # endif()
-    # endif()
+    get_filename_component(_name ${_exports_file} NAME_WE)
+    get_filename_component(_extension ${_exports_file} EXT)
+    get_target_property(_suffix ${_name} SUFFIX)
+    if(${_suffix} STREQUAL "_suffix-NOTFOUND")
+        get_target_property(_type ${_name} TYPE)
+        if(${_type} MATCHES EXECUTABLE)
+            set(_suffix ".exe")
+        else()
+            set(_suffix ".dll")
+        endif()
+    endif()
 
     # if (${_extension} STREQUAL ".spec")
 
@@ -250,28 +250,25 @@
             # 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
-            # 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()
-        # message(FATAL_ERROR "Unsupported exports file extension: ${_extension}")
-    # endif()
-
-    # # Normal importlib target
-    # add_custom_target(
-        # lib${_name}
-        # 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)
-
+    if(${_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
+            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})
+        # Normal importlib target
+        add_custom_target(
+            lib${_name}
+            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)
+    endif()
 endmacro()
 
 macro(spec2def _dllname _spec_file)




More information about the Ros-diffs mailing list