For better context, read bulgogi's synopsis.
Bulc expects every build project to have a project.yaml
file at its root.
my_project
\_ project.yaml
\_ ...
It contains the project layout according to targets and dependencies.
--- # project.yaml
- target1:
- ...
- target2:
- ...
---
Those familiar with UNIX-style file path globs will immediately recognize them.
*
- Match anything excluding path separators (/
).*.c
- Match anything with the.c
file extension.**
- Match anything including path separators (/
).**.c
- Match anything with the.c
file extension recursively.
A project containing the following layout:
my_project
\_ src
\_ abc.c
\_ xyz.c
\_ inc
\_ hjk.h
\_ lmn.h
Can be file-matched using the following patterns:
sources = 'my_project/src/*.c'
headers = 'my_project/inc/*.h'
For each target, bulgogi expects one or more of the following entries:
- A
src
entry containing lists of the source-file patterns (seeGlobbing
). - A
inc
entry containing lists of the header-file patterns (seeGlobbing#Recursive
). - A
pri
entry containing lists of private header-file patterns (seePrivate Headers
). - A
dep
entry containing lists of target-dependencies needed by the target.
--- # project.yaml
- target1:
- src:
- ...
- inc:
- ...
- pri:
- ...
- dep:
- ...
---
Contains one or more source file patterns.
--- # project.yaml
- target1:
- src:
- 'my_project/src/*.c'
---
Contains one or more header file patterns.
--- # project.yaml
- target1:
- inc:
- 'my_project/inc/*.h'
---
Contains one or more prive header file patterns.
--- # project.yaml
- target1:
- pri:
- 'my_project/src/inc/*.h'
---
Note these headers will not be exposed to other targets during linkage.
Refers to one or more project targets as dependencies.
--- # project.yaml
- target1:
- ...
- target2:
- dep:
- target1
---
Note the lack of forward declarations.
-
Given no entries for the target:
- Bulgogi will first look for a root-level directory matching the target name.
- If a matching directory is found, it will then proceed to look for
src
andinc
directories. - If matching directories are found, it will automatically match the following source and header patterns:
'src/*.c'
'src/inc/**.h'
'inc/**.h'
-
Given only a
dep
target entry:- Bulc will assume this is an
INTERFACE
library (see CMakeadd_library#interface-libraries
). - Any targets listed in
dep
must be discoverable in the global namespace of the project to be linked. - Otherwise, see (1) for what will happen to each unmatched entry in
dep
.
- Bulc will assume this is an
-
Given only a
src
target entry:- Bulc will find all matching source files in the provided pattern (see
Globbing
).
- Bulc will find all matching source files in the provided pattern (see
-
Given only a
inc
target entry:- Bulc will find all matching header files in the provided pattern (see
Globbing#Recursive
). - These will be registered as a header-only library (see CMake
add_library#interface-libraries
). - If no other targets depend on this one, no outputs will be produced.
- Bulc will find all matching header files in the provided pattern (see
-
Given only a
pri
target entry:- See (4) - with the caveat that any inclusion under another target's
dep
will not expose any of the headers.
- See (4) - with the caveat that any inclusion under another target's
-
Given a
dep
and asrc
target entry:- See (2) - with the following caveats:
- If no other targets depend on this one, bulc will assume this to be an executable target.
- If at least one other target depends on this one, bulc will assume this to be a standalone library.
- See (2) - with the following caveats:
-
Given a
dep
and ainc
target entry:- See (4).
- Bulc will find all matching header files in the provided
inc
pattern (seeGlobbing#Recursive
). - Target which depend on this one will be exposed to all
dep
entry targets
-
Given a
dep
and apri
target entry:- See (2) - any file patterns in
pri
are ignored.
- See (2) - any file patterns in
-
Given a
dep
,src
andinc
target entry:- See (6) - matching header files in
inc
will be added to the public interface.
- See (6) - matching header files in
-
Given a
src
andinc
target entry:- See (6).
NOTE: These properties are not inherent to bulgogi itself. They are requirements imposed by bulc
.