New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global predicates #6098
Comments
Comment author: @dbuenzli I don't understand. |
Comment author: meyer OK. Let me explain. Normally you define your tags using predicates like this: and <**/test*>: debug debug tag will be defined for every source file in src/ directory having an extension of ml or and prefixed with test. Sometimes however we don't want to associate a predicate with the tag, but instead just want to define a global tag that always holds when it's possible: O3 for the first tag O3 the C compiler will receive an option -O3. : O3 It would also allow to use the tags for ocamlbuild itself: ocamlopt(arm-gnueabi-linux-ocamlopt) copts(-O3) In the later case, it's not possible to associate any predicate, as ocamlbuild is invoked once for the source tree. |
Comment author: meyer Acutally hold on, it's still possible to do it for ocamlbuild, because the command line options might have the same name, and we specify targets in ocamlbuild, therefore ocamlbuild bar/foo.cma ocamlbuild baz/main.native and for this _tags: : copts(O3) : ocamlopt(arm-gnueabi-linux-ocamlopt) So we would have an isomorphism between tags and command line options, possibly dropping completely command line options and replacing with tags. |
Comment author: @damiendoligez ocamlbuild is now a separate project that lives on GitHub. |
Original bug ID: 6098
Reporter: meyer
Status: resolved (set by @damiendoligez on 2017-03-01T15:35:32Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 4.01.1+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Bug description
In ocamlbuild we use _tags to associate predicate with list of tags.
Sometimes it's useful to associate globally set tags, usually it's done in such way:
here debug is universally global tag associated with any path in the source tree
Nothing stops us however say this:
this has the following advantage: it syntactically restrict the tag to work only in global scope. It might be useful for example when mirroring the commandline options as tags:
If the tags where defined using predicate, it might be more difficult to support it in a sane way.
The text was updated successfully, but these errors were encountered: