summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-10-28 19:47:02 -0700
committeryum <yum.food.vr@gmail.com>2025-10-28 19:47:02 -0700
commit30c5fa6808b9a71a47d9e89ad090a824d8ea48c3 (patch)
tree3f8d4ef4213c7ea474811b185c513665488d34e1 /CMakeLists.txt
parent23ff32d84e1f026c68a340f32d9f6b15e953d85a (diff)
accelerate abseil build
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a2db3b..5bee59b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,24 @@ FetchContent_Declare(
abseil
URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.zip
)
-FetchContent_MakeAvailable(abseil)
+
+# Only populate abseil if it hasn't been built yet
+FetchContent_GetProperties(abseil)
+if(NOT abseil_POPULATED)
+ # Check if the built libraries already exist
+ set(ABSEIL_STATUS_LIB "${CMAKE_BINARY_DIR}/_deps/abseil-build/absl/status/absl_status.lib")
+ set(ABSEIL_STATUSOR_LIB "${CMAKE_BINARY_DIR}/_deps/abseil-build/absl/status/absl_statusor.lib")
+
+ if(NOT EXISTS "${ABSEIL_STATUS_LIB}" OR NOT EXISTS "${ABSEIL_STATUSOR_LIB}")
+ message(STATUS "Abseil libraries not found, building abseil...")
+ FetchContent_MakeAvailable(abseil)
+ else()
+ message(STATUS "Abseil libraries found, skipping rebuild")
+ # Manually populate the source directory without building
+ FetchContent_Populate(abseil)
+ add_subdirectory(${abseil_SOURCE_DIR} ${abseil_BINARY_DIR} EXCLUDE_FROM_ALL)
+ endif()
+endif()
add_executable(modular_slang main.cc)
set_target_properties(modular_slang PROPERTIES