aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
-rw-r--r--flake.nix2
2 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..98dbfc4
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.29)
+project(relational_engine_ocaml)
+
+set(CMAKE_CXX_STANDARD 20)
+
+include_directories($ENV{LIBRESSL_INCLUDE_PATH})
+include_directories($ENV{MERKLECPP_INCLUDE_PATH})
+include_directories($ENV{CAML_INCLUDE_PATH})
+
+add_library(relational_engine_ocaml STATIC
+ lib/merklecpp_stubs.cpp)
+
+target_link_libraries(relational_engine_ocaml
+ $ENV{LIBRESSL_LIB_PATH}/libssl.$ENV{OS_LIB_EXTENSION}
+ $ENV{LIBRESSL_LIB_PATH}/libcrypto.$ENV{OS_LIB_EXTENSION}
+) \ No newline at end of file
diff --git a/flake.nix b/flake.nix
index b6f2165..ac1cb49 100644
--- a/flake.nix
+++ b/flake.nix
@@ -202,6 +202,8 @@
MERKLECPP_INCLUDE_PATH="${merklecpp}/include";
LIBRESSL_INCLUDE_PATH="${libressl}/include";
LIBRESSL_LIB_PATH="${libressl}/lib";
+ CAML_INCLUDE_PATH="${legacyPackages.ocaml}/include";
+ OS_LIB_EXTENSION = if legacyPackages.stdenv.isDarwin then "dylib" else "so";
};
# Development tools