diff --git a/Makefile b/Makefile index bf96bcc..f772d3a 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ WATCH?= @install @runtest watch: @dune build $(WATCH) -w +format: + @dune build @fmt --auto-promote + VERSION?= dune-release-distrib: @[ -n "$(VERSION)" ] || (echo "make sure to pass VERSION " && exit 1) diff --git a/examples/dune b/examples/dune index 731dd8b..bd9d05f 100644 --- a/examples/dune +++ b/examples/dune @@ -1,6 +1,5 @@ - (executable - (name prof1) - (modes native) - (flags :standard -warn-error -a+8) ;-linkall) - (libraries tracy-client containers threads.posix)) + (name prof1) + (modes native) + (flags :standard -warn-error -a+8) ;-linkall) + (libraries tracy-client containers threads.posix)) diff --git a/src/bindings/client/dune b/src/bindings/client/dune index 2b3d009..359e9a0 100644 --- a/src/bindings/client/dune +++ b/src/bindings/client/dune @@ -1,8 +1,8 @@ - ; compile client + (foreign_library - (archive_name tracyclient) - (language cxx) - (include_dirs ../tracy/public/tracy/ ../tracy/public) - (flags -DTRACY_ENABLE=1 -fPIC -std=c++11 -O2) - (names TracyClient)) + (archive_name tracyclient) + (language cxx) + (include_dirs ../tracy/public/tracy/ ../tracy/public) + (flags -DTRACY_ENABLE=1 -fPIC -std=c++11 -O2) + (names TracyClient)) diff --git a/src/bindings/dune b/src/bindings/dune index 7eebdd7..6a84b4c 100644 --- a/src/bindings/dune +++ b/src/bindings/dune @@ -1,19 +1,20 @@ - (library - (public_name tracy-client) - (name tracy_client) - (instrumentation.backend (ppx tracy-ppx)) - (synopsis "Bindings to Tracy client library.") - (libraries threads.posix) - (flags :standard -warn-error -a+8 -linkall) - (foreign_archives client/tracyclient) - ;(library_flags -cclib -ltracyclient -cclib -ltracy_stubs) - ; compile our stubs + the client - (foreign_stubs - (language cxx) (names tracy_stubs) - (flags -Wall -fPIC -std=c++11 -O2) - (include_dirs ./tracy)) - ;(c_names tracy_stubs tracyclient) - (c_library_flags -lstdc++) ;-Lsrc/client -ltracyclient) - ;(no_dynlink) - ) + (public_name tracy-client) + (name tracy_client) + (instrumentation.backend + (ppx tracy-ppx)) + (synopsis "Bindings to Tracy client library.") + (libraries threads.posix) + (flags :standard -warn-error -a+8 -linkall) + (foreign_archives client/tracyclient) + ;(library_flags -cclib -ltracyclient -cclib -ltracy_stubs) + ; compile our stubs + the client + (foreign_stubs + (language cxx) + (names tracy_stubs) + (flags -Wall -fPIC -std=c++11 -O2) + (include_dirs ./tracy)) + ;(c_names tracy_stubs tracyclient) + (c_library_flags -lstdc++) ;-Lsrc/client -ltracyclient) + ;(no_dynlink) + ) diff --git a/src/bindings/tracy_client.ml b/src/bindings/tracy_client.ml index 702a5c1..afa789b 100644 --- a/src/bindings/tracy_client.ml +++ b/src/bindings/tracy_client.ml @@ -5,7 +5,7 @@ type span = int external _tracy_enter : file:string -> fun_:string -> line:int -> name:string -> depth:int -> span = "ml_tracy_enter" - [@@noalloc] +[@@noalloc] external _tracy_exit : span -> unit = "ml_tracy_exit" [@@noalloc] external _tracy_name_thread : string -> unit = "ml_tracy_name_thread" @@ -16,13 +16,13 @@ external _tracy_plot : string -> float -> unit = "ml_tracy_plot" [@@noalloc] external _tracy_app_info : string -> unit = "ml_tracy_app_info" external _tracy_span_text : span -> string -> unit = "ml_tracy_span_text" - [@@noalloc] +[@@noalloc] external _tracy_span_value : span -> int64 -> unit = "ml_tracy_span_value" - [@@noalloc] +[@@noalloc] external _tracy_span_color : span -> int -> unit = "ml_tracy_span_color" - [@@noalloc] +[@@noalloc] let enter ?cs_depth ~__FILE__:file ~__LINE__:line ?(__FUNCTION__ = "") name : span = diff --git a/src/trace/dune b/src/trace/dune index 9ab0436..397cbb8 100644 --- a/src/trace/dune +++ b/src/trace/dune @@ -1,6 +1,5 @@ - (library - (name tracy_client_trace) - (public_name tracy-client.trace) - (synopsis "Trace interface for tracy-client") - (libraries tracy-client trace)) + (name tracy_client_trace) + (public_name tracy-client.trace) + (synopsis "Trace interface for tracy-client") + (libraries tracy-client trace)) diff --git a/vendor/dune b/vendor/dune index 112f53d..206086a 100644 --- a/vendor/dune +++ b/vendor/dune @@ -1,2 +1 @@ - (vendored_dirs tracy)