[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ A ] [ B ] [ next ]
ccbuild
- A strict developer's build utility
ccbuild
To be able to use ccbuild
, you as a developer will have to adhere
to some strict(er) rules then using something like autotools. Here is a list
of things you should keep in mind when moving to ccbuild
.
ccbuild
only reads local includes
When creating your source, make sure that all sources that ccbuild
should care about can be found using local includes. This means you should
stricly use system wide includes only for actual system wide include files. So
any header file which is part or your packages should be included using a local
include statement.
Preprocessing isn't helping
To speed up ccbuild
, it doesn't go around looking for system wide
headers. This also means that it won't know all the preprocessing directives
from these headers. This results in preprocessor excludes of local headers
cannot be used. This is no problem if you are compiling for a single platform,
but when you need configuration using preprocessor directives, you're going to
get into trouble.
The only way to keep ccbuild
from reading these sources is by
making sure there is a single space between the # and the
include statement. So the include # include
"something/hello.hh" will be ingored by ccbuild
.
To test this, run ccbuild
in verbose mode (--verbose)
and watch for the warning which state that the file in not included. You can
also use the deps command to get a list for all binary targets.
To set up your ccResolutions file, it's best to do the following steps:
Check your local includes span over your whole source
To make sure ccbuild
was able to follow your local includes, use
the deps command. This will list all the local and global
dependencies of a file. You may also use the dot command to get a graphical
interpertation of the same information.
All paths that ccbuild
needs to search for local includes should
be added to the first line of your ccResolutions file. Using -l
in this first line will make ccbuild
highlight all compiler
output.
#& -I../tools -I. -l
Add packages to your global ccResolutions
You can add a package to your global resolution configuration using the genPkgconfigList.sh tool. This will find all files in the include path of a package's include paths and add them to a resolution file. See the Tools section for more information.
Check the global includes are resolved
To make sure the global includes are resolved, use the resolve command.
ccbuild resolve |sort >> ccResolutions
Now all unresolved global headers are listed in your ccResolutions file. When
you run ccbuild
now, it won't complain about any global includes
missing. However, g++ might complain because the needed extra arguments aren't
in place. You should now add the needed arguments to your ccResolutions file
by using, for example, `pkg-config --cflags --libs
<packagename>` with the needed packagei in place.
If you have a lot of resolution rules in your defaults
(~/.ccbuild/), then it might be hard to see what your project
actually depends on. Passing ccbuild
the option
--nodefres will cause it to skip loading these files and will
allow you to see which resolutions fail. This might give you some hints on
what packages your program depends on.
[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ A ] [ B ] [ next ]
ccbuild
- A strict developer's build utility