diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bd6a8ad7b8..f472cf4af75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ else() # Linking link_directories("${REACTOS_SOURCE_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw) +set(CMAKE_C_LINK_EXECUTABLE " -o ") +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) diff --git a/base/applications/calc/CMakeLists.txt b/base/applications/calc/CMakeLists.txt index 7a75289ccc7..ba34d6f53b3 100644 --- a/base/applications/calc/CMakeLists.txt +++ b/base/applications/calc/CMakeLists.txt @@ -1,7 +1,4 @@ -set(CMAKE_C_LINK_EXECUTABLE " -o -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) diff --git a/base/setup/usetup/CMakeLists.txt b/base/setup/usetup/CMakeLists.txt index 9b746935671..e832044661b 100644 --- a/base/setup/usetup/CMakeLists.txt +++ b/base/setup/usetup/CMakeLists.txt @@ -1,7 +1,4 @@ -set(CMAKE_C_LINK_EXECUTABLE " -o -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) diff --git a/lib/fslib/ext2lib/CMakeLists.txt b/lib/fslib/ext2lib/CMakeLists.txt index a235904f9f3..e5907c14dc0 100644 --- a/lib/fslib/ext2lib/CMakeLists.txt +++ b/lib/fslib/ext2lib/CMakeLists.txt @@ -1,4 +1,4 @@ -include_directories(.) file(GLOB_RECURSE SOURCE "*.c") add_library(ext2lib ${SOURCE}) +add_dependencies(ext2lib psdk) \ No newline at end of file diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt index 063c03e0da0..637eab181ec 100644 --- a/ntoskrnl/CMakeLists.txt +++ b/ntoskrnl/CMakeLists.txt @@ -1,9 +1,6 @@ set(CMAKE_RC_COMPILE_OBJECT " -i -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 ") -set(CMAKE_C_LINK_EXECUTABLE " -o ") -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