Author: akhaldi
Date: Wed Feb 12 11:37:40 2014
New Revision: 62128
URL:
http://svn.reactos.org/svn/reactos?rev=62128&view=rev
Log:
[FREELDR][SETUPLDR]
* Prepare the CMake script for PCH.
* Add header guards to pcbios.h.
CORE-7716
Modified:
trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h
trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Wed Feb 12 11:37:40
2014
@@ -32,6 +32,7 @@
endif()
list(APPEND FREELDR_COMMON_SOURCE
+ include/freeldr.h
cmdline.c
debug.c
linuxboot.c
@@ -121,7 +122,7 @@
windows/headless.c
disk/scsiport.c)
if(NOT MSVC)
- list(APPEND FREELDR_COMMON_SOURCE arch/i386/drvmap.S)
+ list(APPEND FREELDR_COMMON_ASM_SOURCE arch/i386/drvmap.S)
endif()
elseif(ARCH STREQUAL "amd64")
list(APPEND FREELDR_COMMON_ASM_SOURCE
@@ -152,12 +153,9 @@
#TBD
endif()
-if(NOT MSVC)
- add_library(freeldr_common OBJECT ${FREELDR_COMMON_SOURCE}
${FREELDR_COMMON_ASM_SOURCE})
-else()
- add_asm_files(freeldr_common_asm ${FREELDR_COMMON_ASM_SOURCE})
- add_library(freeldr_common ${FREELDR_COMMON_SOURCE} ${freeldr_common_asm})
-endif()
+add_asm_files(freeldr_common_asm ${FREELDR_COMMON_ASM_SOURCE})
+add_library(freeldr_common ${FREELDR_COMMON_SOURCE} ${freeldr_common_asm})
+add_pch(freeldr_common include/freeldr.h FREELDR_COMMON_SOURCE)
add_dependencies(freeldr_common bugcodes)
if(ARCH STREQUAL "i386" AND NOT MSVC)
@@ -173,24 +171,20 @@
list(APPEND FREELDR_BASE_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.def)
endif()
-if(NOT MSVC)
- add_library(freeldr_pe SHARED $<TARGET_OBJECTS:freeldr_common>
${FREELDR_BASE_SOURCE})
- add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE})
- if(SEPARATE_DBG)
- set_target_properties(freeldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
- set_target_properties(freeldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
- endif()
+add_library(freeldr_pe SHARED ${FREELDR_BASE_SOURCE})
+add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
+
+if(NOT MSVC AND SEPARATE_DBG)
+ set_target_properties(freeldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+ set_target_properties(freeldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+endif()
+
+if(MSVC)
+ add_target_link_flags(freeldr_pe "/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 ")
+ add_target_link_flags(freeldr_pe_dbg "/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")
else()
- add_library(freeldr_pe SHARED ${FREELDR_BASE_SOURCE})
- add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
-endif()
-
-if(NOT MSVC)
add_target_link_flags(freeldr_pe
"-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
add_target_link_flags(freeldr_pe_dbg
"-Wl,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
-else()
- add_target_link_flags(freeldr_pe "/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 ")
- add_target_link_flags(freeldr_pe_dbg "/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")
endif()
set_image_base(freeldr_pe 0x10000)
@@ -206,15 +200,8 @@
target_link_libraries(freeldr_pe_dbg mini_hal)
endif()
-if(MSVC)
- target_link_libraries(freeldr_pe freeldr_common)
- target_link_libraries(freeldr_pe_dbg freeldr_common)
-endif()
-
-target_link_libraries(freeldr_pe cportlib cmlib rtl libcntpr)
-target_link_libraries(freeldr_pe_dbg cportlib cmlib rtl libcntpr)
-
-# add_pch(freeldr_pe include/freeldr.h)
+target_link_libraries(freeldr_pe freeldr_common cportlib cmlib rtl libcntpr)
+target_link_libraries(freeldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr)
add_dependencies(freeldr_pe asm)
add_dependencies(freeldr_pe_dbg asm)
@@ -237,24 +224,20 @@
list(APPEND SETUPLDR_SOURCE windows/setupldr.c)
endif()
-if(NOT MSVC)
- add_library(setupldr_pe SHARED $<TARGET_OBJECTS:freeldr_common>
${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
- add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
- if(SEPARATE_DBG)
- set_target_properties(setupldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
- set_target_properties(setupldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
- endif()
+add_library(setupldr_pe SHARED ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
+add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE}
${SETUPLDR_SOURCE})
+
+if(NOT MSVC AND SEPARATE_DBG)
+ set_target_properties(setupldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+ set_target_properties(setupldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+endif()
+
+if(MSVC)
+ add_target_link_flags(setupldr_pe "/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")
+ add_target_link_flags(setupldr_pe_dbg "/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")
else()
- add_library(setupldr_pe SHARED ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
- add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE}
${SETUPLDR_SOURCE})
-endif()
-
-if(NOT MSVC)
add_target_link_flags(setupldr_pe
"-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
add_target_link_flags(setupldr_pe_dbg
"-Wl,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
-else()
- add_target_link_flags(setupldr_pe "/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")
- add_target_link_flags(setupldr_pe_dbg "/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")
endif()
add_target_compile_definitions(setupldr_pe FREELDR_REACTOS_SETUP)
@@ -273,13 +256,8 @@
target_link_libraries(setupldr_pe_dbg mini_hal)
endif()
-if(MSVC)
- target_link_libraries(setupldr_pe freeldr_common)
- target_link_libraries(setupldr_pe_dbg freeldr_common)
-endif()
-
-target_link_libraries(setupldr_pe cportlib cmlib rtl libcntpr)
-target_link_libraries(setupldr_pe_dbg cportlib cmlib rtl libcntpr)
+target_link_libraries(setupldr_pe freeldr_common cportlib cmlib rtl libcntpr)
+target_link_libraries(setupldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr)
add_dependencies(setupldr_pe asm)
add_dependencies(setupldr_pe_dbg asm)
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h [iso-8859-1] Wed Feb 12
11:37:40 2014
@@ -1,3 +1,6 @@
+#ifndef _PCBIOS_H_
+#define _PCBIOS_H_
+
#ifndef __ASM__
typedef enum
@@ -139,3 +142,4 @@
#define REGS_EFLAGS 36
#define REGS_SIZE 40
+#endif /* _PCBIOS_H_ */
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Wed Feb 12 11:37:40
2014
@@ -122,4 +122,4 @@
VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);
VOID RunLoader(VOID);
-#endif // defined __FREELDR_H
+#endif /* __FREELDR_H */