[CMAKE]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 22 Nov 2010 14:11:16 +0000 (14:11 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 22 Nov 2010 14:11:16 +0000 (14:11 +0000)
Use spec file for ntoskrnl and set image base to 0x00400000 on MSVC builds. This is the value that Windows has and the ms linker doesn't like to use the kernel address.

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

ntoskrnl/CMakeLists.txt

index ae4148c..8fd16a1 100644 (file)
@@ -1,4 +1,6 @@
 
+spec2def(ntoskrnl.exe ntoskrnl.spec)
+
 include_directories(
     ${REACTOS_SOURCE_DIR}
     ${REACTOS_SOURCE_DIR}/lib/cmlib
@@ -246,7 +248,7 @@ list(APPEND SOURCE
     wmi/wmi.c
     ntoskrnl.rc
     ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
-    ntoskrnl_${ARCH}.def)
+    ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
     
 set_source_files_properties(ntoskrnl_${ARCH}.def PROPERTIES EXTERNAL_OBJECT TRUE)
 
@@ -408,7 +410,11 @@ add_executable(ntoskrnl ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl_ntoskrnl.h.gch ${SO
 
 set_entrypoint(ntoskrnl KiSystemStartup@4)
 set_subsystem(ntoskrnl native)
-set_image_base(ntoskrnl 0x80800000)
+if(MSVC)
+  set_image_base(ntoskrnl 0x00400000)
+else()
+  set_image_base(ntoskrnl 0x80800000)
+endif()
 
 target_link_libraries(ntoskrnl
     cportlib