Merge pull request #1335 from ariscop/CMP0065
[reactos.git] / ntoskrnl / CMakeLists.txt
index 86d62e7..d1ee382 100644 (file)
@@ -10,7 +10,6 @@ set(NTKRNLMP_SOURCE ${SOURCE})
 set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
 
 spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
-
 add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
 
 add_executable(ntoskrnl
@@ -19,6 +18,7 @@ add_executable(ntoskrnl
     guid.c
     ntoskrnl.rc
     ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
+set_property(TARGET ntoskrnl PROPERTY ENABLE_EXPORTS TRUE)
 
 if(ARCH STREQUAL "i386")
     set_entrypoint(ntoskrnl KiSystemStartup 4)
@@ -29,6 +29,7 @@ set_subsystem(ntoskrnl native)
 
 if(MSVC)
     set_image_base(ntoskrnl 0x00400000)
+    add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from bugcheck code
 else()
     if(GDB)
         set_image_base(ntoskrnl 0x00800000)
@@ -37,19 +38,12 @@ else()
     endif()
 endif()
 
-target_link_libraries(ntoskrnl
-    cportlib
-    csq
-    ${PSEH_LIB}
-    cmlib
-    rtl
-    ${ROSSYM_LIB}
-    libcntpr
-    wdmguid
-    ioevent)
+target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
 
 if(STACK_PROTECTOR)
     target_link_libraries(ntoskrnl gcc_ssp)
+elseif(RUNTIME_CHECKS)
+    target_link_libraries(ntoskrnl runtmchk)
 endif()
 
 add_importlibs(ntoskrnl hal kdcom bootvid)
@@ -64,3 +58,4 @@ endif()
 add_asm_files(ntdllsys_asm ntdll.S)
 add_library(ntdllsys ${ntdllsys_asm})
 set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
+add_dependencies(ntdllsys asm)
\ No newline at end of file