summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2016-09-10 10:13:37 +0100
committerChris Wilson <chris+github@qwirx.com>2016-09-10 10:13:37 +0100
commit7de9857420507b192f3628c567c61f4e9b849bed (patch)
tree97b350583179fb69e237b0db05f5153b8e9f7cdd
parent4c34bf6cd51e3ebe5a6ac21cbdae6b90d9def78e (diff)
Optimisation: for CMake builds, replace generated files only if changed.
Speeds up local development by avoiding unnecessary rebuilds when files have not changed.
-rw-r--r--infrastructure/cmake/CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt
index fa364690..db919939 100644
--- a/infrastructure/cmake/CMakeLists.txt
+++ b/infrastructure/cmake/CMakeLists.txt
@@ -72,7 +72,10 @@ function(move_file_if_exists source_file dest_file)
endfunction()
foreach(file_to_configure ${files_to_configure})
- configure_file("${base_dir}/${file_to_configure}.in" "${base_dir}/${file_to_configure}" @ONLY)
+ configure_file("${base_dir}/${file_to_configure}.in" "${base_dir}/${file_to_configure}.out" @ONLY)
+ replace_file_if_different(
+ "${base_dir}/${file_to_configure}"
+ "${base_dir}/${file_to_configure}.out")
endforeach()
# Work out the current Box version (requires Perl) and update lib/common/BoxVersion.h,