mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 17:01:49 +00:00
[CMAKE] Add the kernel module type
Take this as an occasion to use target_link_options more
This commit is contained in:
parent
812c9e5a11
commit
e55123a6a2
5 changed files with 125 additions and 71 deletions
|
@ -285,11 +285,15 @@ function(set_module_type_toolchain MODULE TYPE)
|
|||
if(${TYPE} STREQUAL "wdmdriver")
|
||||
target_link_options(${MODULE} PRIVATE "-Wl,--wdmdriver")
|
||||
endif()
|
||||
# Place INIT section at the tail of the module
|
||||
# Place INIT &.rsrc section at the tail of the module, before .reloc
|
||||
add_linker_script(${MODULE} ${REACTOS_SOURCE_DIR}/sdk/cmake/init-section.lds)
|
||||
# Fixup section characteristiscs
|
||||
# Fixup section characteristics
|
||||
# - Remove flags that LD overzealously puts (alignment flag, Initialized flags for code sections)
|
||||
# - INIT section is made discardable
|
||||
# - .rsrc is made read-only
|
||||
# - PAGE & .edata sections are made pageable.
|
||||
add_custom_command(TARGET ${MODULE} POST_BUILD
|
||||
COMMAND native-pefixup --driver $<TARGET_FILE:${MODULE}>)
|
||||
COMMAND native-pefixup --${TYPE} $<TARGET_FILE:${MODULE}>)
|
||||
# Believe it or not, cmake doesn't do that
|
||||
set_property(TARGET ${MODULE} APPEND PROPERTY LINK_DEPENDS $<TARGET_PROPERTY:native-pefixup,IMPORTED_LOCATION>)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue