about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/CMakeLists.txt')
-rw-r--r--third_party/nix/src/libstore/CMakeLists.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/third_party/nix/src/libstore/CMakeLists.txt b/third_party/nix/src/libstore/CMakeLists.txt
index 4bfbb165f6b2..246377cc9b8d 100644
--- a/third_party/nix/src/libstore/CMakeLists.txt
+++ b/third_party/nix/src/libstore/CMakeLists.txt
@@ -1,8 +1,11 @@
 # -*- mode: cmake; -*-
 add_library(nixstore SHARED)
+add_library(nixstoremock SHARED)
 set_property(TARGET nixstore PROPERTY CXX_STANDARD 17)
+set_property(TARGET nixstoremock PROPERTY CXX_STANDARD 17)
 include_directories(${PROJECT_BINARY_DIR}) # for config.h
 target_include_directories(nixstore PUBLIC "${nix_SOURCE_DIR}/src")
+target_include_directories(nixstoremock PUBLIC "${nix_SOURCE_DIR}/src")
 
 # The database schema is stored in schema.sql, but needs to be
 # available during the build as static data.
@@ -101,8 +104,24 @@ target_link_libraries(nixstore
   sodium
 )
 
+target_sources(nixstoremock
+  PUBLIC
+    mock-binary-cache-store.hh
+
+  PRIVATE
+    mock-binary-cache-store.cc
+)
+
+target_link_libraries(nixstoremock
+  nixstore
+
+  absl::btree
+  absl::flat_hash_map
+  glog
+)
+
 configure_file("nix-store.pc.in" "${PROJECT_BINARY_DIR}/nix-store.pc" @ONLY)
 INSTALL(FILES "${PROJECT_BINARY_DIR}/nix-store.pc" DESTINATION "${PKGCONFIG_INSTALL_DIR}")
 
 INSTALL(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nix/libstore)
-INSTALL(TARGETS nixstore DESTINATION ${CMAKE_INSTALL_LIBDIR})
+INSTALL(TARGETS nixstore nixstoremock DESTINATION ${CMAKE_INSTALL_LIBDIR})