2 if(ARCH MATCHES i386 OR ARCH MATCHES amd64)
3 CreateBootSectorTarget2(frldr16
4 ${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
5 ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
9 include_directories(BEFORE include)
10 include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
11 include_directories(${REACTOS_SOURCE_DIR}/lib/cmlib)
12 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs)
13 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/elf)
15 add_definitions(-D_NTHAL_ -D_BLDR_ -D_NTSYSTEM_)
18 if(SARCH MATCHES omap-zoom2)
19 add_definitions(-D_ZOOM2_)
23 list(APPEND FREELDR_COMMON_SOURCE
75 list(APPEND FREELDR_COMMON_SOURCE
88 arch/i386/i386pnp.cmake.S
92 arch/i386/linux.cmake.S
111 arch/i386/xboxvideo.c
112 windows/i386/ntsetup.c
113 windows/i386/wlmemory.c
117 list(APPEND FREELDR_COMMON_SOURCE
119 arch/i386/multiboot.S)
121 elseif(ARCH MATCHES amd64)
122 list(APPEND FREELDR_COMMON_SOURCE
139 windows/amd64/ntsetup.c
140 windows/amd64/wlmemory.c)
145 add_library(freeldr_common ${FREELDR_COMMON_SOURCE})
146 add_dependencies(freeldr_common bugcodes)
149 list(APPEND FREELDR_BASE_SOURCE
150 bootmgr.c # This file is compiled with custom definitions
156 add_executable(freeldr_pe ${FREELDR_BASE_SOURCE})
159 set_target_properties(freeldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk")
161 set_target_properties(freeldr_pe PROPERTIES LINK_FLAGS "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION")
164 set_image_base(freeldr_pe 0x10000)
165 set_subsystem(freeldr_pe native)
166 set_entrypoint(freeldr_pe RealEntryPoint)
168 if(ARCH MATCHES i386)
169 target_link_libraries(freeldr_pe mini_hal)
172 target_link_libraries(freeldr_pe
180 add_pch(freeldr_pe include/freeldr.h)
181 add_dependencies(freeldr_pe asm)
184 ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
185 ${CMAKE_CURRENT_BINARY_DIR}/freeldr_pe.exe
186 ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
188 add_custom_target(freeldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
190 add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINATION loader NO_CAB FOR all)
192 list(APPEND SETUPLDR_SOURCE
196 if(ARCH MATCHES i386 OR ARCH MATCHES amd64)
197 list(APPEND SETUPLDR_SOURCE windows/setupldr2.c)
201 set_source_files_properties(${SETUPLDR_SOURCE} PROPERTIES COMPILE_FLAGS "-ffreestanding -fno-builtin -fno-inline -fno-zero-initialized-in-bss")
204 add_executable(setupldr_pe ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
207 set_target_properties(setupldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
209 set_target_properties(setupldr_pe PROPERTIES LINK_FLAGS "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
212 set_image_base(setupldr_pe 0x10000)
213 set_subsystem(setupldr_pe native)
214 set_entrypoint(setupldr_pe RealEntryPoint)
216 if(ARCH MATCHES i386)
217 target_link_libraries(setupldr_pe mini_hal)
220 target_link_libraries(setupldr_pe
228 add_dependencies(setupldr_pe asm)
231 ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
232 ${CMAKE_CURRENT_BINARY_DIR}/setupldr_pe.exe
233 ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
235 add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
237 add_cd_file(TARGET setupldr FILE ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys DESTINATION loader NO_CAB FOR all)