From 134f9f930e988c699c72aefcbc21c8f1950e53b0 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 11 Mar 2020 04:28:48 -0700 Subject: [PATCH] [sledge] Adjust build system to allow building as a vendored dependency Summary: Move definitions of profiles from `dune-workspace` to `dune` since it seems to be ok to use profiles in `dune-workspace` that are only defined in `dune`. Since the `dune` but not `dune-workspace` file is used when building as a vendored dependency, this seems to be preferable. Also, change the `opt` profile into a wildcard, which seems to be preferable from the vendored-building perspective. Also, set library public names such that including `sledge` in the `libraries` phrase of `dune` files works. Reviewed By: ngorogiannis Differential Revision: D20376179 fbshipit-source-id: f2b634716 --- sledge/dune | 23 +++++++++++++++++++++++ sledge/dune-workspace | 25 +------------------------ sledge/lib/dune | 1 + 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/sledge/dune b/sledge/dune index d2d76d948..7a22ea385 100644 --- a/sledge/dune +++ b/sledge/dune @@ -3,6 +3,29 @@ ; This source code is licensed under the MIT license found in the ; LICENSE file in the root directory of this source tree. +(env + (dbg + (flags + (-w +a-4-9-18-40-42-44-48@50-66 -strict-formats -strict-sequence + -short-paths -bin-annot -keep-locs -keep-docs -opaque)) + (env-vars + (PPX_TRACE_ENABLED 1)) + (inline_tests enabled)) + (dbg-opt + (flags + (-w -a -noassert -unboxed-types)) + (ocamlopt_flags (-O3)) + (env-vars + (PPX_TRACE_ENABLED 1)) + (inline_tests disabled)) + (_ + (flags + (-w -a -noassert -unboxed-types)) + (ocamlopt_flags (-O3)) + (env-vars + (PPX_TRACE_ENABLED 0)) + (inline_tests disabled))) + (dirs :standard \ llvm test) (rule diff --git a/sledge/dune-workspace b/sledge/dune-workspace index a7b15e663..852c5860b 100644 --- a/sledge/dune-workspace +++ b/sledge/dune-workspace @@ -5,29 +5,6 @@ ; This source code is licensed under the MIT license found in the ; LICENSE file in the root directory of this source tree. -(env - (dbg - (flags - (-w +a-4-9-18-40-42-44-48@50-66 -strict-formats -strict-sequence - -short-paths -bin-annot -keep-locs -keep-docs -opaque)) - (env-vars - (PPX_TRACE_ENABLED 1)) - (inline_tests enabled)) - (opt - (flags - (-w -a -noassert -unboxed-types)) - (ocamlopt_flags (-O3)) - (env-vars - (PPX_TRACE_ENABLED 0)) - (inline_tests disabled)) - (dbg-opt - (flags - (-w -a -noassert -unboxed-types)) - (ocamlopt_flags (-O3)) - (env-vars - (PPX_TRACE_ENABLED 1)) - (inline_tests disabled))) - (context (opam (switch sledge) (name dbg) (profile dbg) (merlin))) -(context (opam (switch sledge) (name opt) (profile opt))) (context (opam (switch sledge) (name dbg-opt) (profile dbg-opt))) +(context (opam (switch sledge) (name opt) (profile opt))) diff --git a/sledge/lib/dune b/sledge/lib/dune index 6f16daefa..2f5ef1952 100644 --- a/sledge/lib/dune +++ b/sledge/lib/dune @@ -5,6 +5,7 @@ (library (name sledgelib) + (public_name sledge) (libraries trace import) (flags (:standard -open Import))