Skip to content

Commit

Permalink
Toggle more CC options when building using the 'dev' profile.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed May 30, 2024
1 parent 44bf4c3 commit a2dc673
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 17 additions & 0 deletions config/configure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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})))
2 changes: 1 addition & 1 deletion test/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a2dc673

Please sign in to comment.