Commit Graph

14 Commits

Author SHA1 Message Date
Christian Blichmann
e21afae5a7 CMake: Build contrib sandboxes if requested
Add a new option `SAPI_ENABLE_CONTRIB_TESTS` that builds the sandboxes
in `contrib/` if set.

The new `contrib/CMakeLists.txt` should be extended each time we add a
new sandbox to `contrib/`.

This is in preparation of a follow-up change that should test the
sandboxes using GitHub Actions.

Drive-by:
- Rename the tests in `jsonnet_tests.cc` to conform to the style guide.
PiperOrigin-RevId: 425874289
Change-Id: I5b31546ccf84444c2480287220ef88abbd78a235
2022-02-02 07:02:28 -08:00
Christian Blichmann
d451478e26 Change license link to HTTPS URL
PiperOrigin-RevId: 424811734
Change-Id: If5ea692edc56ddc9c99fd478673df41c0246e9cc
2022-01-28 01:39:09 -08:00
Christian Blichmann
baa1e570b4 CMake build: Skip examples/tests when used via add_subdirectory
PiperOrigin-RevId: 422512365
Change-Id: I38c6b23d1b33b89346ccf6c6692d50f88c82212b
2022-01-18 03:23:16 -08:00
Anton D. Kachalov
0e8d16e011 Enable shared libraries build and cross-compilation
This allows resource-constrained environments to benefit from the
space savings of dynamic linking. This is not meant to be used in
the general case.

PiperOrigin-RevId: 347398828
Change-Id: Ia634959148a31159878f48c44255dd733424a2b8
2020-12-14 09:16:14 -08:00
Sandboxed API Team
d172411d7b Force -fno-exceptions compiler option.
Add hardening compiler options (enabled via SAPI_HARDENED_SOURCE)

PiperOrigin-RevId: 347081406
Change-Id: I6c293a95a3bb05ea3b581bd9497381847c7aa510
2020-12-11 14:58:27 -08:00
Christian Blichmann
143e539d79 First MVP of a LibTooling based SAPI header generator
- Extract dependent types directly from the Clang AST and re-serialize
  back into compilable code
- Collect types and emit diagnostics
- Format generated code

Signed-off-by: Christian Blichmann <mail@blichmann.eu>
2020-05-15 15:35:42 +02:00
Christian Blichmann
aafc597630 Add zlib as dependency for examples
Similar to what the Bazel build does, this change adds zlib as an additional
dependency when `SAPI_ENABLE_EXAMPLES` is set to `ON`.

PiperOrigin-RevId: 309203959
Change-Id: I201a9e6415789afb1e058bc48cebbc0fc0004fe9
2020-04-30 04:57:33 -07:00
Christian Blichmann
0772d71264 Download libffi at CMake config time (fixes #35)
Drive-by:
- Make Bazel config action more robust
- Disable dependency tracking in libunwind configure

Signed-off-by: Christian Blichmann <mail@blichmann.eu>
2020-03-22 16:44:39 +01:00
Christian Blichmann
441201884a Update license header with recommended best practices
PiperOrigin-RevId: 290250533
Change-Id: Ic34b253446463cf971a055b70a242df93a598ee3
2020-01-17 05:05:29 -08:00
Christian Blichmann
e7eb1f97a3 Download and build libcap along with other dependencies when using CMake
PiperOrigin-RevId: 282353228
Change-Id: I3175949556b2468eb252bc618e6c6d10a8ada68f
2019-11-25 07:30:40 -08:00
Christian Blichmann
948b75efe9 CMake cleanups
- Bump minimum requred version to 3.12 (Ubuntu Cosmic LTS)
- Rename `SAPI_USE_?` options to `SAPI_DOWNLOAD_?`
- Improve detection of Python 3
- Use platform independent static library suffixes for `find_library()`

PiperOrigin-RevId: 281727467
Change-Id: I45596b6ba08e4f8201d8dcde19a03baf825b83ec
2019-11-21 05:17:25 -08:00
Christian Blichmann
d47c066112 Enable sapi_test target in CMake, add Benchmark dependency
PiperOrigin-RevId: 281719298
Change-Id: Idd2570fff4907c81cdab1070bd1f3e41e29c76f6
2019-11-21 04:04:14 -08:00
Christian Blichmann
3c51348aaf Enable CMake projects to consume Sandboxed API via add_subdirectory()
This change moves away from a classical superbuild which downloads and builds
at build time. Instead, we now follow a "Fetch Content" workflow (available as
FetchContent in CMake 3.11+) and download dependencies at config time.

Rationale: Superbuild projects have the disadvantage that projects cannot
directly access their individual declared targets. This is not a problem with
regular libraries, as those are usually/supposed to be installed. With
Sandboxed API, this is not desirable, as it has dependencies like Abseil and
glog, which are almost always consumed by including their source tree using
add_subdirectory().

Fixes #10 and makes external embedding easier.

PiperOrigin-RevId: 260129870
Change-Id: I70f295f29a6e4fc8c330512c94b01ef10c017166
2019-07-26 05:51:08 -07:00
Christian Blichmann
6d33c1f908 Add CMake options to exclude examples and tests from build
PiperOrigin-RevId: 258136393
Change-Id: Ifb2d7a24f93cd1d2782b4e4d6ac2c34a0d1c2bff
2019-07-15 04:42:58 -07:00