[CMAKE]
[reactos.git] / reactos / tools / wpp / CMakeLists.txt
index dd8d528..f418c95 100644 (file)
@@ -3,16 +3,35 @@ if(MSVC)
     add_definitions(
         -Dsnprintf=_snprintf
         -Dstrtoull=_strtoui64
+        -Dstrtoll=_strtoi64)
+
+    # Add this definition for WDK only, VS 9 doesn't like that
+    if (DEFINED ENV{DDKBUILDENV})
+        add_definitions(
+            -Dvsnprintf=_vsnprintf)
+    endif()
+endif()
+
+if(CMAKE_CROSSCOMPILING)
+    add_definitions(
+        -D_DLL -D__USE_CRTIMP
+        -D__NO_ISOCEXT
+        -Dstrtoull=_strtoui64
         -Dstrtoll=_strtoi64
-        -Dvsnprintf=_vsnprintf)
+        -Dopen=_open
+        -Dclose=_close)
+
+    include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 endif()
 
 list(APPEND SOURCE
-    lex.yy.c
     preproc.c
     wpp.c
+    ppl.yy.c
     ppy.tab.c)
 
-add_library(wpp ${SOURCE})
-
-add_dependencies(wpp build_header)
\ No newline at end of file
+if(CMAKE_CROSSCOMPILING)
+    add_library(wpp ${SOURCE})
+else()
+    add_library(wpphost ${SOURCE})
+endif()