mirror of
https://github.com/reactos/reactos.git
synced 2025-07-13 16:14:22 +00:00
[CMAKE]
- separate the custom target and the custom command generating reactos.cab, so that it isn't regenerated each time a bootcd is built Note to make user: I tried a hack so that the sequence 'make module/fast reactos_cab/fast bootcd/fast' still works, but this is untested. Please use ninja if you really want fast dependency resolution. svn path=/trunk/; revision=63837
This commit is contained in:
parent
16623e02fa
commit
b51defb8ad
3 changed files with 28 additions and 7 deletions
|
@ -18,10 +18,14 @@ foreach(_hive ${_common_hives})
|
||||||
COMMAND native-utf16le ${_hive} ${_converted_hive}
|
COMMAND native-utf16le ${_hive} ${_converted_hive}
|
||||||
DEPENDS native-utf16le ${_hive})
|
DEPENDS native-utf16le ${_hive})
|
||||||
list(APPEND _converted_common_hives ${_converted_hive})
|
list(APPEND _converted_common_hives ${_converted_hive})
|
||||||
add_cd_file(FILE ${_converted_hive} DESTINATION reactos NO_CAB FOR bootcd regtest)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(converted_hives DEPENDS ${_converted_common_hives})
|
add_custom_target(converted_hives DEPENDS ${_converted_common_hives})
|
||||||
|
add_cd_file(TARGET converted_hives
|
||||||
|
FILE ${_converted_common_hives}
|
||||||
|
DESTINATION reactos
|
||||||
|
NO_CAB
|
||||||
|
FOR bootcd regtest)
|
||||||
|
|
||||||
# livecd hives
|
# livecd hives
|
||||||
list(APPEND _livecd_hives
|
list(APPEND _livecd_hives
|
||||||
|
|
|
@ -15,12 +15,18 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake "
|
||||||
|
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn "")
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn "")
|
||||||
|
|
||||||
|
# This finalizes reactos.dff by concat-ing the two files: one generated and one static containing the optional file.
|
||||||
|
# please keep it this way as it permits to add files to reactos.dff.in without having to run cmake again
|
||||||
|
# and also avoids rebuilding reactos.cab in case nothing changes after a cmake run
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff
|
||||||
COMMAND ${CMAKE_COMMAND} -D SRC1=${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in
|
COMMAND ${CMAKE_COMMAND} -D SRC1=${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in
|
||||||
-D SRC2=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn
|
-D SRC2=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn
|
||||||
-D DST=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff
|
-D DST=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.maydiff
|
||||||
-P ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake
|
-P ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.maydiff
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/reactos.dff
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn
|
||||||
)
|
)
|
||||||
|
@ -34,10 +40,15 @@ add_custom_command(
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff native-cabman)
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff native-cabman)
|
||||||
|
|
||||||
# Then we create the actual cab file using a custom target
|
# Then we create the actual cab file using a custom target
|
||||||
# Please do not change this into custom command + custom target. This breaks reactos.cab dependencies on modules
|
add_custom_command(
|
||||||
# and you can't do something like "make gdi32/fast reactos_cab/fast bootcd/fast"
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab
|
||||||
add_custom_target(reactos_cab
|
|
||||||
COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -L ${CMAKE_CURRENT_BINARY_DIR} -N -P ${REACTOS_SOURCE_DIR}
|
COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -L ${CMAKE_CURRENT_BINARY_DIR} -N -P ${REACTOS_SOURCE_DIR}
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf native-cabman)
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf native-cabman)
|
||||||
|
|
||||||
add_cd_file(TARGET reactos_cab FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf DESTINATION reactos NO_CAB FOR bootcd regtest)
|
add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab)
|
||||||
|
|
||||||
|
add_cd_file(
|
||||||
|
TARGET reactos_cab
|
||||||
|
FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf
|
||||||
|
DESTINATION reactos
|
||||||
|
NO_CAB FOR bootcd regtest)
|
||||||
|
|
|
@ -318,6 +318,12 @@ function(add_cd_file)
|
||||||
if(_CD_TARGET)
|
if(_CD_TARGET)
|
||||||
#manage dependency
|
#manage dependency
|
||||||
add_dependencies(reactos_cab ${_CD_TARGET})
|
add_dependencies(reactos_cab ${_CD_TARGET})
|
||||||
|
# add this so that the combination make target/fast reactos_cab/fast bootcd/fast properly detects that reactos.cab must be rebuilt
|
||||||
|
if (CMAKE_BUILD_TOOL STREQUAL "make")
|
||||||
|
add_custom_command(TARGET ${_CD_TARGET}
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif() #end bootcd
|
endif() #end bootcd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue