Commit 425673a
committed
cmake: optionally build
Unlike the `Makefile`-based build, the CMake configuration unfortunately
does not let us easily encapsulate Scalar's build definition in the
`contrib/scalar/` subdirectory: The `scalar` executable needs to link in
`libgit.a` and `common-main.o`, for example.
Also, `scalar.c` includes Git's header files, which means that
`scalar.c` needs to be compiled with the very same flags as `libgit.a`
lest `scalar.o` and `libgit.a` have different ideas of, say,
`platform_SHA_CTX`, which would naturally lead to memory corruption,
crashes and quite tricky debugging (talking from experience).
To alleviate that lack of encapsulation somewhat, we guard the Scalar
parts in `CMakeLists.txt` via the `INCLUDE_SCALAR` environment variable.
This not only allows the CMake-based build to exclude Scalar by default,
but also gives better visual cues as to which sections are related to
Scalar.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>scalar, too1 parent 6b74337 commit 425673a
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
813 | 820 | | |
814 | 821 | | |
815 | 822 | | |
| |||
1037 | 1044 | | |
1038 | 1045 | | |
1039 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1040 | 1054 | | |
1041 | 1055 | | |
1042 | 1056 | | |
| |||
0 commit comments