[CMAKE]
[reactos.git] / reactos / drivers / storage / classpnp / CMakeLists.txt
index f0f9884..c3968a0 100644 (file)
@@ -9,15 +9,7 @@ add_definitions(
     -DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE=512
     -DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS=512)
 
-if(ARCH MATCHES i386)
-    if(MSVC)
-        add_definitions(/Gz)
-    else()
-        add_definitions(-mrtd -fno-builtin -w)
-    endif()
-endif()
-
-spec2def(classpnp.sys classpnp.spec)
+spec2def(classpnp.sys classpnp.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
     autorun.c
@@ -34,13 +26,27 @@ list(APPEND SOURCE
     retry.c
     utils.c
     xferpkt.c
-    class.rc
     ${CMAKE_CURRENT_BINARY_DIR}/classpnp.def)
 
-add_library(classpnp SHARED ${SOURCE})
+add_library(classpnp SHARED
+    ${SOURCE}
+    class.rc)
+
+if(ARCH MATCHES i386)
+    # FIXME: http://www.cmake.org/Bug/view.php?id=12998
+    if(MSVC)
+        #add_target_compile_flags(classpnp "/Gz")
+        set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "/Gz")
+    else()
+        
+        #add_target_compile_flags(classpnp "-mrtd -fno-builtin -w")
+        set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-mrtd -fno-builtin -w")
+    endif()
+endif()
+
 add_pch(classpnp classp.h)
 target_link_libraries(classpnp ${PSEH_LIB} libcntpr)
 set_module_type(classpnp kernelmodedriver)
 add_importlibs(classpnp hal ntoskrnl)
-add_importlib_target(classpnp.spec)
+
 add_cd_file(TARGET classpnp DESTINATION reactos/system32/drivers NO_CAB FOR all)