diff --git a/Makefile b/Makefile index 4a4aa8d..2c9e28f 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,15 @@ BUILD_DIR:=$(ROOT)/_build .PHONY: all all: dune-project - dune build --build-dir=$(BUILD_DIR) + dune build --profile=dev --build-dir=$(BUILD_DIR) .PHONY: install install: - dune install --build-dir=$(BUILD_DIR) + dune install --profile=dev --build-dir=$(BUILD_DIR) .PHONY: uninstall uninstall: - dune uninstall --build-dir=$(BUILD_DIR) + dune uninstall --profile=dev --build-dir=$(BUILD_DIR) .PHONY: release release: diff --git a/config/configure.ml b/config/configure.ml index a50f4fd..cd176d0 100644 --- a/config/configure.ml +++ b/config/configure.ml @@ -11,6 +11,23 @@ let add_flag flag = add_native_flag flag let () = + let is_dev_profile = + try + let arg = Array.get Sys.argv 1 in + String.equal arg "dev" + with + | Invalid_argument _ -> false + in + let () = + if is_dev_profile then + let debug_options = + [ "-Wall"; "-Wextra"; "-Wpedantic" + ; "-Wformat=2"; "-Wno-unused-parameter"; "-Wshadow" + ; "-Wwrite-strings"; "-Wstrict-prototypes"; "-Wold-style-definition" + ; "-Wredundant-decls"; "-Wnested-externs"; "-Wmissing-include-dirs" ] + in + List.iter add_flag debug_options + in let options = [ "UNIQUE_FIBERS" ] in diff --git a/lib/dune b/lib/dune index 8c0beb4..5275355 100644 --- a/lib/dune +++ b/lib/dune @@ -15,4 +15,4 @@ (rule (targets c_byte_flags.sexp c_native_flags.sexp) - (action (run ../config/configure.exe))) + (action (run ../config/configure.exe %{profile}))) diff --git a/test/lib/dune b/test/lib/dune index 8032e09..fefb836 100644 --- a/test/lib/dune +++ b/test/lib/dune @@ -15,7 +15,7 @@ (rule (targets c_byte_flags.sexp c_native_flags.sexp) - (action (run ../../config/configure.exe))) + (action (run ../../config/configure.exe %{profile}))) (executable (name unique_fibers)