summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Arnaud Botella <arnaud.botella@geode-solutions.com>2024-07-15 08:48:49 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2024-07-15 08:49:48 -0700
commit646126a4e194d96de407a70f385a656744123116 (patch)
tree2031f5a4de180b0c6f983686bdaac9eb8b71dbf8 /CMakeLists.txt
parentb86d574c5a8ca3344d02c312a63cebb49deeacfc (diff)
PR #1715: Generate options.h using CMake only once
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1715 Using abseil via CMake ExternalProject, for each compilation abseil is reconfigured. This leads to a new options-pinned.h generated and then a new options.h installed. Because of that new options.h file, all projects depending on abseil recompile entirely. Using file(GENERATE ...) instead of file(WRITE ...) allows generating options-pinned.h only when the content is new or changed. Merge b3b53860d1f6cc83283806117cd5d341159b6052 into cd75cb4ae32c46c84cef9a9c78b42174f22ed0ac Merging this change closes #1715 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1715 from BotellaA:patch-1 b3b53860d1f6cc83283806117cd5d341159b6052 PiperOrigin-RevId: 652495570 Change-Id: Ib14bd9a78f80a540aae73d7a94cb46e2c05e8509
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 85e0ec3a..3184383b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,7 +249,7 @@ if(ABSL_ENABLE_INSTALL)
ABSL_INTERNAL_OPTIONS_H_PINNED
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
- file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
+ file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base