Author: akhaldi
Date: Sun Oct 24 12:44:36 2010
New Revision: 49258
URL:
http://svn.reactos.org/svn/reactos?rev=49258&view=rev
Log:
[CMAKE]
- Add set_image_base macro.
- Fix ks linking.
Modified:
branches/cmake-bringup/drivers/ksfilter/ks/CMakeLists.txt
branches/cmake-bringup/gcc.cmake
Modified: branches/cmake-bringup/drivers/ksfilter/ks/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/ksfilter/…
==============================================================================
--- branches/cmake-bringup/drivers/ksfilter/ks/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/ksfilter/ks/CMakeLists.txt [iso-8859-1] Sun Oct 24
12:44:36 2010
@@ -26,9 +26,10 @@
kcom.c
ks.rc)
-set_target_properties(ks PROPERTIES LINK_FLAGS "-Wl,-entry,0
-Wl,--image-base,0x00010000 -Wl,--subsystem,native" SUFFIX ".sys")
-
-set_module_type(ks kernelmodedriver)
+set_target_properties(ks PROPERTIES SUFFIX ".sys")
+set_entrypoint(ks 0)
+set_subsystem(ks native)
+set_image_base(ks 0x00010000)
target_link_libraries(ks
${CMAKE_CURRENT_SOURCE_DIR}/ks.def
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=492…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Sun Oct 24 12:44:36 2010
@@ -56,6 +56,15 @@
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
endmacro()
+macro(set_image_base MODULE IMAGE_BASE)
+ set(NEW_LINKER_FLAGS "-Wl,--image-base,${IMAGE_BASE}")
+ get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
+ if(LINKER_FLAGS)
+ set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
+ endif()
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
+endmacro()
+
macro(add_importlibs MODULE)
foreach(LIB ${ARGN})
target_link_libraries(${MODULE} ${LIB}.dll.a)
@@ -106,9 +115,10 @@
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
endif()
if(${TYPE} MATCHES kernelmodedriver)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,--image-base,0x00010000 -Wl,--exclude-all-symbols" SUFFIX
".sys")
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,--exclude-all-symbols" SUFFIX ".sys")
set_entrypoint(${MODULE} DriverEntry@8)
set_subsystem(${MODULE} native)
+ set_image_base(${MODULE} 0x00010000)
add_dependencies(${MODULE} bugcodes)
endif()
endmacro()