diff --git a/pkgs/development/tools/parsing/tree-sitter/library.nix b/pkgs/development/tools/parsing/tree-sitter/library.nix index 2d5d3e7d0b4d..36245ff7d449 100644 --- a/pkgs/development/tools/parsing/tree-sitter/library.nix +++ b/pkgs/development/tools/parsing/tree-sitter/library.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation { configurePhase= ":"; buildPhase = '' runHook preBuild - $CC -I$src/src/ -shared -o parser -Os $src/src/parser.c + scanner_cc="$src/src/scanner.cc" + if [ ! -f "$scanner_cc" ]; then + scanner_cc="" + fi + $CC -I$src/src/ -shared -o parser -Os $src/src/parser.c $scanner_cc -lstdc++ runHook postBuild ''; installPhase = ''