fix(3p/nix): Fix string escaping issue in schema include

The SQL schemas are included as string constants which are
concatenated into a header file. In the previous Makefiles, this was
done with envsubst or something - we moved it to CMake.

There was a missing quote around the string to be interpolated, which
meant that CMake interpreted the semicolons as part of its language
syntax and did not emit them.

Change-Id: Ibb4512788b26b53f297db3535094dc0194614446
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1342
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2020-07-22 02:17:10 +01:00 committed by tazjin
parent 3b02fcb0a7
commit 950ba404be

View file

@ -13,11 +13,11 @@ file(READ "schema.sql" NIX_SCHEMA)
string(CONFIGURE
"#pragma once
namespace nix {
constexpr char kNixSqlSchema[] = R\"(${NIX_SCHEMA})\"\;
constexpr char kNixSqlSchema[] = R\"(${NIX_SCHEMA})\";
}"
NIX_SCHEMA_GEN)
file(WRITE ${PROJECT_BINARY_DIR}/generated/schema.sql.hh ${NIX_SCHEMA_GEN})
file(WRITE ${PROJECT_BINARY_DIR}/generated/schema.sql.hh "${NIX_SCHEMA_GEN}")
set(HEADER_FILES
binary-cache-store.hh