mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
Generate options.h using CMake only once
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user