* Sync up to trunk head (r65353).
[reactos.git] / drivers / storage / classpnp / CMakeLists.txt
index 1d5672b..47846cf 100644 (file)
@@ -1,5 +1,6 @@
 
 include_directories(../inc)
+spec2def(classpnp.sys classpnp.spec ADD_IMPORTLIB)
 
 add_definitions(
     -DCLASS_GLOBAL_BREAK_ON_LOST_IRPS=0
@@ -9,16 +10,6 @@ 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 class.spec)
-
 list(APPEND SOURCE
     autorun.c
     class.c
@@ -34,11 +25,20 @@ list(APPEND SOURCE
     retry.c
     utils.c
     xferpkt.c
+    classp.h)
+
+add_library(classpnp SHARED
+    ${SOURCE}
+    guid.c
     class.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/class.def)
+    ${CMAKE_CURRENT_BINARY_DIR}/classpnp.def)
+
+if((ARCH STREQUAL "i386") AND (NOT MSVC))
+    # FIXME: http://www.cmake.org/Bug/view.php?id=12998
+    set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=switch")
+endif()
 
-add_library(classpnp SHARED ${SOURCE})
-add_pch(classpnp classp.h)
+add_pch(classpnp classp.h SOURCE)
 target_link_libraries(classpnp ${PSEH_LIB} libcntpr)
 set_module_type(classpnp kernelmodedriver)
 add_importlibs(classpnp hal ntoskrnl)