3 ## LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 ## PURPOSE: Common build definitions
5 ## COPYRIGHT: Copyright 2003 Brian Palmer <brianp@sginet.com>
6 ## Copyright 2011-2014 Amine Khaldi <amine.khaldi@reactos.org>
7 ## Copyright 2011-2014 Timo Kreuzer <timo.kreuzer@reactos.org>
8 ## Copyright 2014 Hervé Poussineau <hpoussin@reactos.org>
9 ## Copyright 2023 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
13 # Explicitly use string pooling
14 add_compile_options("/GF")
17 #spec2def(freeldr_pe.exe freeldr.spec)
19 include_directories(BEFORE include)
21 ${REACTOS_SOURCE_DIR}/ntoskrnl/include
22 ${REACTOS_SOURCE_DIR}/sdk/lib/cmlib
23 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs
24 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/elf)
26 add_definitions(-D_NTHAL_ -D_BLDR_ -D_NTSYSTEM_)
28 list(APPEND FREELDR_ARC_SOURCE
38 list(APPEND FREELDR_BOOTLIB_SOURCE
52 lib/inifile/ini_init.c
59 list(APPEND FREELDR_BOOTMGR_SOURCE
76 list(APPEND FREELDR_NTLDR_SOURCE
77 ${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmboot.c
84 if(ARCH STREQUAL "i386")
86 list(APPEND FREELDR_COMMON_ASM_SOURCE
90 list(APPEND FREELDR_ARC_SOURCE
96 list(APPEND FREELDR_NTLDR_SOURCE
97 ntldr/arch/i386/winldr.c
100 elseif(ARCH STREQUAL "amd64")
101 list(APPEND FREELDR_COMMON_ASM_SOURCE
105 list(APPEND FREELDR_ARC_SOURCE
107 arch/i386/ntoskrnl.c)
109 list(APPEND FREELDR_NTLDR_SOURCE
110 ntldr/arch/amd64/winldr.c)
112 elseif(ARCH STREQUAL "arm")
113 list(APPEND FREELDR_NTLDR_SOURCE
114 ntldr/arch/arm/winldr.c)
120 list(APPEND FREELDR_BASE_SOURCE
121 bootmgr.c # This file is compiled with custom definitions
123 ntldr/setupldr.c ## Strangely enough this file is needed in GCC builds
124 ## even if ${FREELDR_NTLDR_SOURCE} is not added,
125 ## otherwise we get linking errors with Rtl**Bitmap** APIs.
126 ## Do not happen on MSVC builds however...
131 if(ARCH STREQUAL "i386")
132 # Must be included together with disk/scsiport.c
133 list(APPEND FREELDR_BASE_SOURCE
134 ${CMAKE_CURRENT_BINARY_DIR}/freeldr_pe.def)
138 if(NOT ARCH STREQUAL "i386" OR NOT (SARCH STREQUAL "pc98" OR SARCH STREQUAL "xbox"))