mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
avoid unneccessary rebuild of all-in-one targets upon project re-configuration
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
692bdb0788
commit
99ab64cf7f
1 changed files with 5 additions and 1 deletions
|
@ -191,6 +191,9 @@ function(KATIE_SETUP_TARGET FORTARGET)
|
|||
katie_warning("All-in-one build not yet support for: ${FORTARGET}")
|
||||
set(${FORTARGET}_SOURCES ${resourcesdep} ${ARGN} PARENT_SCOPE)
|
||||
else()
|
||||
# use temporary file, then configure_file() to avoid all-in-one target rebuilds when the
|
||||
# project is reconfigured
|
||||
set(allinonetemp "${CMAKE_CURRENT_BINARY_DIR}/allinone_temporary.cpp")
|
||||
set(allinonesource "${CMAKE_CURRENT_BINARY_DIR}/${FORTARGET}_allinone.cpp")
|
||||
set(allinonedata)
|
||||
foreach(srcstring ${ARGN})
|
||||
|
@ -199,7 +202,8 @@ function(KATIE_SETUP_TARGET FORTARGET)
|
|||
set(allinonedata "${allinonedata}#include \"${srcstring}\"\n")
|
||||
endif()
|
||||
endforeach()
|
||||
file(WRITE ${allinonesource} "${allinonedata}")
|
||||
file(WRITE "${allinonetemp}" "${allinonedata}")
|
||||
configure_file("${allinonetemp}" "${allinonesource}")
|
||||
set(${FORTARGET}_SOURCES ${resourcesdep} ${allinonesource} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
Loading…
Add table
Reference in a new issue