Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tiamo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Maximilien COLANGE
tiamo
Commits
c8045f6d
Commit
c8045f6d
authored
Feb 29, 2016
by
Maximilien Colange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle assertions and debugging modes from the ocaml tags file.
parent
04564cfb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
5 deletions
+54
-5
Makefile.am
Makefile.am
+1
-1
configure.ac
configure.ac
+45
-0
myocamlbuild.ml
myocamlbuild.ml
+7
-3
src/_tags.in
src/_tags.in
+1
-1
No files found.
Makefile.am
View file @
c8045f6d
...
...
@@ -10,7 +10,7 @@ OCAMLBUILD=ocamlbuild -use-ocamlfind -classic-display -build-dir $(BUILDDIR) @OC
UTAP_INCLUDEDIR
=
@abs_top_srcdir@/utap/src
UTAP_LIB
=
@abs_top_srcdir@/utap/src/libutap.a
CXX_FLAGS
=
-std
=
c++11
-O3
-DNDEBUG
@TIAMO_MACROS@
-I
$(UTAP_INCLUDEDIR)
-I
@abs_top_srcdir@/src
CXX_FLAGS
=
-std
=
c++11 @TIAMO_MACROS@
-I
$(UTAP_INCLUDEDIR)
-I
@abs_top_srcdir@/src
XML_LINK_FLAGS
=
$(
foreach
i,
$(XML_LIBS)
,-cclib
$i
)
...
...
configure.ac
View file @
c8045f6d
...
...
@@ -40,6 +40,51 @@ AC_SUBST(XML_CONFIG)
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
OCAMLTAGS=""
dnl Check for debug flags
enableval=no
AC_MSG_CHECKING([whether to compile with debug info])
AC_ARG_ENABLE(debugging,
AS_HELP_STRING([--enable-debugging], [compile with debugging information]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
OPT_FLAGS="$OPT_FLAGS -g"
OCAMLTAGS="$OCAMLTAGS, debug"
;;
no)
AC_MSG_RESULT(no)
OPT_FLAGS="$OPT_FLAGS -O3"
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-debugging, needs yes or no])
;;
esac
enableval=no
AC_MSG_CHECKING([whether to enable checking of run-time assertions])
AC_ARG_ENABLE(assertions,
AS_HELP_STRING([--enable-assertions], [check run-time assertions]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
AC_DEFINE(NDEBUG, 1, [Assertions are disabled when this is defined])
OPT_FLAGS="$OPT_FLAGS -DNDEBUG"
OCAMLTAGS="$OCAMLTAGS, noassert"
;;
*)
AC_MSG_ERROR([bad value ${enableval} --enable-assertions, needs yes or no])
;;
esac
CFLAGS="$OPT_FLAGS"
CPPFLAGS="$OPT_FLAGS"
AC_SUBST(OCAMLTAGS)
AC_SUBST(OCAMLBUILDFLAGS)
AC_CONFIG_SUBDIRS([utap])
...
...
myocamlbuild.ml
View file @
c8045f6d
...
...
@@ -18,8 +18,8 @@ let cxx_flags = ["-xc++"; "-fPIC"; Sys.getenv "CXX_FLAGS"]
(* a helper function *)
(* prefix every c++ flags with -ccopt *)
let
ocaml_cxx_flags
=
fun
flags
->
let
camlflags
=
List
.
flatten
(
List
.
map
(
fun
opt
->
[
"-ccopt"
;
opt
])
(
cxx_flags
@
flags
)
)
in
S
[
A
"-cc"
;
A
cxx
;
atomize
camlflags
]
let
camlflags
=
List
.
flatten
(
List
.
map
(
fun
opt
->
[
"-ccopt"
;
opt
])
flags
)
in
atomize
camlflags
(* TODO add C options when seeing tags:
* noassert -> add '-DNDEBUG'
...
...
@@ -33,9 +33,13 @@ let _ =
|
After_rules
->
(* TODO declare the internal utap library here *)
(* a custom noassert flag, only for compilation, not preprocessing *)
flag
[
"compile"
;
"noassert"
]
(
A
"-noassert"
);
(* set proper compilation flags for c++ *)
flag
[
"c++"
]
(
ocaml_cxx_flags
[
]
);
flag
[
"c++"
]
(
S
[
A
"-cc"
;
A
cxx
;
ocaml_cxx_flags
cxx_flags
]);
flag
[
"c++"
;
"debug"
]
(
ocaml_cxx_flags
[
"-g"
]);
flag
[
"c++"
;
"noassert"
]
(
ocaml_cxx_flags
[
"-DNDEBUG"
]);
(* explicit link dependency for C-based object files *)
pdep
[
"link"
]
"linkdep"
(
fun
param
->
[
param
])
...
...
src/_tags.in
View file @
c8045f6d
<*>: bin_annot
<*.c> or <*.cm{o,x}> or <main.native>:
debug, custom
<*.c> or <*.cm{o,x}> or <main.native>:
custom @OCAMLTAGS@
<main.native>: use_dynlink, linkdep(src/timedAutomatonBuilder.o)
<costs.ml>: pp(camlp4o pa_macro.cmo @TIAMO_MACROS@)
<timedAutomatonBuilder.c>: c++
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment