oasis
oasis copied to clipboard
Problem with generated C headers
This bug has been migrated from artifact #990 on forge.ocamlcore.org. It was assigned to user102.
user925 posted on 2011-06-07 12:12:53:
In my project I need to generate C header files with an internal tool that uses C stub To illustrate this problem/bug/feature request I have made a simple example :
The _oasis file describes a project as follow :
There are two executables :
Executable gen_header Path: . MainIs: gen_header.ml Install: false Custom: true CSources: add.c Executable test_header Path: . MainIs: test_header.ml BuildTools: gen_header Custom: true CSources: myconst.c, generated_header.h
generated_header.h is produced by the executable gen_header. So I naturally add a rule in myocamlbuild.ml.
The problem is that for building gen_header, it tries to build gen_header.h : so we naturally have an error message.
/bin/sh: ./gen_header: not found
We can notice that if we work with generated_header.c instead of generated header.h there is no problem.
The only solution I have found to go around this problem is to :
-
remove generated_header.h in the _oasis file
-
add dep ["file:myconst.c"] ["generated_header.h"] in the myocamlbuild.ml file