about summary refs log tree commit diff
path: root/third_party/nix/CMakeLists.txt
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-04T21·02+0100
committertazjin <mail@tazj.in>2020-08-05T11·37+0000
commit3f923b2aa0d976fb18e7038d4e2701e878c6784b (patch)
tree6a786f324ddf3c6fb39fe3786ce120313a0f9f5c /third_party/nix/CMakeLists.txt
parentffa8e7a9986260280b5a3f415f73b47a53ba25c3 (diff)
refactor(tvix): Use SANDBOX_SHELL from environment in CMake r/1597
This makes the configuration work out-of-the-box using CMake in a Nix
shell, rather than having to pass the additional variable to CMake on
the command line.

Change-Id: I04d3cc4f2e5ecf47bf2ee459d5e48588b84ae4dd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1643
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'third_party/nix/CMakeLists.txt')
-rw-r--r--third_party/nix/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/third_party/nix/CMakeLists.txt b/third_party/nix/CMakeLists.txt
index e37bef9383b3..200b604c22f8 100644
--- a/third_party/nix/CMakeLists.txt
+++ b/third_party/nix/CMakeLists.txt
@@ -40,7 +40,9 @@ if (CLANG_TIDY_PATH)
   endif()
 endif()
 
-if (NOT SANDBOX_SHELL)
+if (DEFINED ENV{SANDBOX_SHELL})
+  set(SANDBOX_SHELL ENV{SANDBOX_SHELL})
+else()
   find_program(BUSYBOX busybox)
   if (BUSYBOX)
     set(SANDBOX_SHELL "${BUSYBOX}")