-
Notifications
You must be signed in to change notification settings - Fork 410
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
Change compiler flags based on OCaml version #90
Comments
I don't think #56 will ever be implemented. It won't be enough in the long term; jbuilder will have to support OCaml plugins properly. For simple things, I have been working on a small meta-programming language for jbuild files, see this jbuild for instance. Eventually there'll also be a way to change the default flags for a given scope, so you'll be able to write this in a toplevel jbuild file: (set_defaults
((ocamlopt_flags
(:standard
(:if (:ver> %{ocaml_version} 4.02) -O3)
(:if %{dev} -w @a))))) In the meantine, you indeed need to resort to the OCaml syntax. |
#235 makes the suggestion that we could automate the removal of flags (which I think is a good idea) |
Here is an example where this can be useful: ocurrent/ocaml-ci#265
Any news on that? |
|
I'd like to compile a library with
-O3
. Since OCaml 4.02 doesn't support that flag, I'd like to skip it for that version of the compiler.I tried using
:include
, but it looks likeocamlopt_flags
doesn't support that (undefined symbol :include
). Is there another way (short of switching to the OCaml jbuild syntax)?I guess #56 would also solve my problem, if implemented.
The text was updated successfully, but these errors were encountered: