mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 02:13:29 +00:00
[CMAKE]
- Generalize CMAKE_C_LINK_EXECUTABLE and CMAKE_EXE_LINKER_FLAGS, and use additional flags per module. - Fix usetup: make it depend on psdk and buildno_header, and also fix the entry point (_NtProcessStartup -> _NtProcessStartup@4) - Make ext2lib depend on psdk. svn path=/branches/cmake-bringup/; revision=48802
This commit is contained in:
parent
6730fe41ce
commit
13dc8a4761
|
@ -32,6 +32,8 @@ else()
|
|||
|
||||
# Linking
|
||||
link_directories("${REACTOS_SOURCE_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw)
|
||||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
|
||||
|
||||
# Activate support for assembly source files
|
||||
enable_language(ASM)
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-L${REACTOS_BINARY_DIR}/lib/3rdparty/mingw")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,-entry,_WinMainCRTStartup -Wl,--enable-stdcall-fixup -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
|
||||
|
||||
add_definitions(-DUNICODE -D_UNICODE)
|
||||
add_definitions(-DDISABLE_HTMLHELP_SUPPORT=1)
|
||||
|
||||
|
@ -20,4 +17,6 @@ target_link_libraries(calc mingw_wmain mingw_common
|
|||
-lgdi32
|
||||
-lmsvcrt)
|
||||
|
||||
set_target_properties(calc PROPERTIES LINK_FLAGS "-Wl,-entry,_WinMainCRTStartup")
|
||||
|
||||
add_dependencies(calc psdk)
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-L${REACTOS_BINARY_DIR}/lib/3rdparty/mingw")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,-entry,_NtProcessStartup -Wl,--enable-stdcall-fixup -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/lib/newinflib)
|
||||
include_directories(${REACTOS_SOURCE_DIR}/lib/3rdparty/zlib)
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/drivers)
|
||||
|
@ -40,3 +37,7 @@ target_link_libraries(usetup
|
|||
vfatlib
|
||||
mingw_common
|
||||
-lmsvcrt)
|
||||
|
||||
set_target_properties(usetup PROPERTIES LINK_FLAGS "-Wl,-entry,_NtProcessStartup@4")
|
||||
|
||||
add_dependencies(usetup psdk buildno_header)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
include_directories(.)
|
||||
file(GLOB_RECURSE SOURCE "*.c")
|
||||
add_library(ext2lib ${SOURCE})
|
||||
add_dependencies(ext2lib psdk)
|
|
@ -1,9 +1,6 @@
|
|||
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> <CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -I${REACTOS_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/include -O coff -o <OBJECT> ")
|
||||
|
||||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,-entry,_KiSystemStartup@4 -Wl,--image-base,0x80800000 -Wl,--kill-at -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds -Wl,--subsystem,native")
|
||||
|
||||
add_definitions(-D__NTOSKRNL__)
|
||||
add_definitions(-D_NTOSKRNL_)
|
||||
add_definitions(-D_NTSYSTEM_)
|
||||
|
@ -406,7 +403,7 @@ endif(_WINKD_ MATCHES 0)
|
|||
|
||||
add_executable(ntoskrnl ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl_ntoskrnl.h.gch)
|
||||
|
||||
set_target_properties(ntoskrnl PROPERTIES LINK_FLAGS "-Wl,-entry,_KiSystemStartup@4")
|
||||
set_target_properties(ntoskrnl PROPERTIES LINK_FLAGS "-Wl,-entry,_KiSystemStartup@4 -Wl,--image-base,0x80800000 -Wl,--subsystem,native")
|
||||
|
||||
target_link_libraries(ntoskrnl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ntoskrnl_i386.def
|
||||
|
|
Loading…
Reference in a new issue