Skip to content

Commit 646126a

Browse files
BotellaAcopybara-github
authored andcommitted
PR #1715: Generate options.h using CMake only once
Imported from GitHub PR #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 b3b5386 into cd75cb4 Merging this change closes #1715 COPYBARA_INTEGRATE_REVIEW=#1715 from BotellaA:patch-1 b3b5386 PiperOrigin-RevId: 652495570 Change-Id: Ib14bd9a78f80a540aae73d7a94cb46e2c05e8509
1 parent b86d574 commit 646126a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ if(ABSL_ENABLE_INSTALL)
249249
ABSL_INTERNAL_OPTIONS_H_PINNED
250250
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
251251

252-
file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
252+
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
253253

254254
install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h"
255255
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base

0 commit comments

Comments
 (0)