[CMAKE]
[reactos.git] / hal / CMakeLists.txt
index 32f251c..2800513 100644 (file)
@@ -28,10 +28,6 @@ list(APPEND HAL_GENERIC_SOURCE
     halx86/generic/i386/systimer.S
     halx86/generic/i386/trap.S)
 
-add_library(hal_generic ${HAL_GENERIC_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/hal_generic_hal.h.gch)
-add_pch(hal_generic ${CMAKE_CURRENT_SOURCE_DIR}/halx86/include/hal.h ${HAL_GENERIC_SOURCE})
-add_dependencies(hal_generic psdk bugcodes)
-
 list(APPEND HAL_GENERIC_PCAT_SOURCE
     halx86/generic/legacy/bus/bushndlr.c
     halx86/generic/legacy/bus/cmosbus.c
@@ -42,29 +38,30 @@ list(APPEND HAL_GENERIC_PCAT_SOURCE
     halx86/generic/legacy/bussupp.c
     halx86/generic/legacy/halpcat.c)
 
-add_library(hal_generic_pcat ${HAL_GENERIC_PCAT_SOURCE})
-add_dependencies(hal_generic_pcat psdk)
-
 list(APPEND HAL_GENERIC_UP_SOURCE
     halx86/generic/spinlock.c
     halx86/up/pic.c
     halx86/up/processor.c)
 
-add_library(hal_generic_up ${HAL_GENERIC_UP_SOURCE})
-add_dependencies(hal_generic_up psdk)
 
-set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
-add_library(hal SHARED halx86/up/halinit_up.c halx86/up/halup.rc)
+list(APPEND HAL_SOURCE
+    ${CMAKE_CURRENT_BINARY_DIR}/hal_hal.h.gch
+    ${HAL_GENERIC_SOURCE}
+    ${HAL_GENERIC_PCAT_SOURCE}
+    ${HAL_GENERIC_UP_SOURCE}
+    halx86/up/halinit_up.c
+    halx86/up/halup.rc)
 
-set_target_properties(hal PROPERTIES LINK_FLAGS "-Wl,-entry,_HalInitSystem@8")
+add_library(hal SHARED ${HAL_SOURCE})
+add_pch(hal ${CMAKE_CURRENT_SOURCE_DIR}/halx86/include/hal.h ${HAL_SOURCE})
+add_dependencies(hal psdk bugcodes)
+
+set_target_properties(hal PROPERTIES LINK_FLAGS "-Wl,-entry,_HalInitSystem@8 -Wl,--image-base,0x00010000 -Wl,--subsystem,native")
 
 target_link_libraries(hal
     ${CMAKE_CURRENT_SOURCE_DIR}/halx86/hal_i386.def
-    -Wl,--whole-archive hal_generic -Wl,--no-whole-archive
-    hal_generic_pcat
-    hal_generic_up
-    ${REACTOS_SOURCE_DIR}/ntoskrnl/libntoskrnl.a
+    -lntoskrnl
     libcntpr)
 
 list(APPEND MINI_HAL_SOURCE
@@ -99,9 +96,10 @@ list(APPEND MINI_HAL_SOURCE
 endif(ARCH MATCHES i386)
 
 add_library(mini_hal ${MINI_HAL_SOURCE})
-set_property(TARGET mini_hal PROPERTY COMPILE_DEFINITIONS _BLDR_ _MINIHAL_)
+set_property(TARGET mini_hal PROPERTY COMPILE_DEFINITIONS "_BLDR_;_MINIHAL_")
 add_dependencies(mini_hal psdk bugcodes)
-
+add_minicd_target(hal reactos hal.dll)
+add_livecd_target(hal reactos/system32 hal.dll)
 else()
 #TBD
 endif(ARCH MATCHES i386)
\ No newline at end of file