{"id":20267124,"url":"https://github.com/lifting-bits/cxx-common","last_synced_at":"2026-03-11T06:31:21.470Z","repository":{"id":38238668,"uuid":"88639646","full_name":"lifting-bits/cxx-common","owner":"lifting-bits","description":"Common dependency management for various Trail of Bits C++ codebases","archived":false,"fork":false,"pushed_at":"2024-06-17T14:15:31.000Z","size":997,"stargazers_count":34,"open_issues_count":21,"forks_count":12,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-11T03:40:14.258Z","etag":null,"topics":["c-plus-plus"],"latest_commit_sha":null,"homepage":null,"language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lifting-bits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-18T15:16:34.000Z","updated_at":"2025-01-27T20:27:04.000Z","dependencies_parsed_at":"2024-04-16T15:34:49.095Z","dependency_job_id":"87ab9ac4-8f18-41f4-a59c-d4a8c6a5caec","html_url":"https://github.com/lifting-bits/cxx-common","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/lifting-bits/cxx-common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fcxx-common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fcxx-common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fcxx-common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fcxx-common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifting-bits","download_url":"https://codeload.github.com/lifting-bits/cxx-common/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fcxx-common/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus"],"created_at":"2024-11-14T12:13:20.161Z","updated_at":"2026-03-11T06:31:20.710Z","avatar_url":"https://github.com/lifting-bits.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VCPKG Ports for lifting-bits C/C++ projects\n\nCurated dependencies that are compatible with the [lifting-bits](https://github.com/lifting-bits) tools.\n\n## Pre-built\n\nEvery [release](https://github.com/lifting-bits/cxx-common/releases), we publish compressed archives of the pre-built dependencies built by [vcpkg](https://github.com/microsoft/vcpkg) with the CMake `Release` build type.\n\nWe only officially support and test the libraries built for the OSs that appear in CI. If an OS or architecture is not listed in a release, please open an issue so that we can track potential support.\n\nTo use the dependencies, just download the compressed file and decompress it. The resulting directory _does not require_ installation of anything other than a C++ compiler and recent version of CMake to use with a project.\n\nFor example:\n\n```bash\ncurl -LO https://github.com/lifting-bits/cxx-common/releases/latest/download/vcpkg_ubuntu-22.04_llvm-16_amd64.tar.xz\ntar -xJf vcpkg_ubuntu-22.04_llvm-16_amd64.tar.xz\n```\n\nWill produce a directory, and then you'll have to set the following during your CMake configure command to use these dependencies!\n\n```text\n-DCMAKE_TOOLCHAIN_FILE=\"\u003c...\u003e/vcpkg_ubuntu-22.04_llvm-16_amd64/scripts/buildsystems/vcpkg.cmake\" -DVCPKG_TARGET_TRIPLET=x64-linux-rel\n```\n\nReplace `x64-linux-rel` with `x64-osx-rel` if using the macOS pre-built download.\n\n## Building from source\n\nIf you aren't running a supported operating system, or you want to have dependencies with a build type other than `Release`, you can build everything from source using the `./build_dependencies.sh` script (pass `--help` to see available options).\n\nBy default, the script will install the dependencies listed in [`dependencies.txt`](./dependencies.txt), which doesn't include an LLVM version, so passing an `llvm-16` string as an argument will actually be passed to [`vcpkg install`](https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md#install). Any other strings not matching the script's own options are also passed to the `vcpkg install` command. Furthermore, without specifying any other build script options, vcpkg determine determine the best triplet for your operating system, which means building _both_ `Debug` and `Release` build types (see the [vcpkg triplet docs](https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md) for more info).\n\nYou can customize the features that a particular package is built with by specifying the feature name between brackets, i.e. `llvm-16[target-all]` (build all target backends), to ensure non-default features are also installed along with all default features. The list of features can be found in the target port's `vcpkg.json` file. Please read the [vcpkg docs](https://github.com/microsoft/vcpkg/blob/master/docs/users/selecting-library-features.md#installing-additional-features) for more information about specifying additional features.\n\n```bash\n./build_dependencies.sh llvm-16\n```\n\nNote that vcpkg will use binary caching to store built dependency packages (usually at `~/.cache/vcpkg` or manually set with environment variable `VCPKG_DEFAULT_BINARY_CACHE`) so that upon reinstallation/rebuilding (re-running the script) you likely won't have to rebuild everything from scratch, unless the package itself has been updated, you are using a different vcpkg triplet, your compiler has been changed/update, or any of the vcpkg scripts have changed (updated vcpkg repo). If you'd like to turn off [binary caching](https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md) (not recommended), then you can either pass `--no-binarycaching` to the build script after the main options listed in or add `-binarycaching` to the `VCPKG_FEATURE_FLAGS` environment variable.\n\n**ATTENTION**: If you are having issues it is best to start fresh. Delete all of the created `vcpkg` directory. If you have binary caching on and nothing has changed, then you should be able to quickly reuse your previously built dependencies.\n\n### Export Directories\n\nPassing `--export-dir \u003cDIR\u003e` to the `./build_dependencies.sh` script, you can install the chosen dependencies in a separate directory. Otherwise, the built dependencies will be stored within the vcpkg repo directory itself (`vcpkg/installed` relative path if in the root of this repo). Separate export directories are required to keep track of different LLVM versions, since they cannot coexist within the same export (read: installation) directory.\n\n```bash\n./build_dependencies.sh --export-dir vcpkg-llvm-16-install llvm-16\n```\n\nwill build all of the dependencies listed in `dependencies.txt` _and_ LLVM 15 and install into a local directory named `vcpkg-llvm-16-install`.\n\nFurthermore, you are able to install additional dependencies into an existing exported directory created by this script by setting the `--export-dir \u003cpath\u003e` to the same path:\n\n```bash\n./build_dependencies.sh --release --export-dir \"\u003c...\u003e/vcpkg_ubuntu-22.04_llvm-16_amd64\" spdlog\n```\n\nWhen reusing the pre-built export directory downloaded from GitHub, you must specify `--release` (see the 'Debug and Release Builds' section below) to build only release binaries. You cannot use dependencies from different triplets.\n\n### Debug and Release Builds\n\nTo build both debug and release versions with llvm-16, just run the following\n\n```bash\n./build_dependencies.sh llvm-16\n```\n\nThe script will be verbose about what it is doing and will clone the correct version of vcpkg (found in `vcpkg_info.txt`) and build everything in the `vcpkg` directory in the root of this repo.\n\nAt the end it will print how to use the library:\n\n```bash\n$ ./build_dependencies.sh --export-dir example-export-dir\n...\n[+] Set the following in your CMake configure command to use these dependencies!\n[+]   -DCMAKE_TOOLCHAIN_FILE=\"/Users/ekilmer/src/cxx-common/vcpkg/scripts/buildsystems/vcpkg.cmake\" -DVCPKG_TARGET_TRIPLET=x64-osx -DVCPKG_HOST_TRIPLET=x64-osx\n```\n\n## Just release builds\n\nIf you don't want to compile a debug version of the tools, just pass `--release` to the script.\n\n```bash\n$ ./build_dependencies.sh --release llvm-16\n...\n[+] Set the following in your CMake configure command to use these dependencies!\n[+]   -DCMAKE_TOOLCHAIN_FILE=\"/Users/ekilmer/src/cxx-common/vcpkg/scripts/buildsystems/vcpkg.cmake\" -DVCPKG_TARGET_TRIPLET=x64-osx-rel -DVCPKG_HOST_TRIPLET=x64-osx-rel\n```\n\n### Address Sanitizer\n\n:warning: **Not tested on all vcpkg packages.** Open an issue if a tool's dependency cannot be built with sanitizers.\n\nThere is experimental support for compiling dependencies with address sanitizer using the `*-asan` suffix for `osx` and `linux` triplets.\n\nThese dependencies can be built with the script by passing `--asan` to the script, and it should work whether building only Release or both Debug and Release:\n\n```bash\n./build_dependencies.sh [--release] --asan llvm-16\n```\n\nJust because your dependencies were built with a sanitizer, you'll still need to manually add support for sanitizer usage within your own project. A quick and dirty way involves specifying the extra compilation flags during CMake configure:\n\n```bash\n$ cmake \\\n  -DVCPKG_ROOT=\"\u003cpath_to_vcpkg\u003e\" \\\n  -DVCPKG_TARGET_TRIPLET=x64-linux-rel-asan \\\n  -DCMAKE_CXX_FLAGS=\"-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls -ffunction-sections -fdata-sections\" \\\n  -DCMAKE_C_FLAGS=\"-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls -ffunction-sections -fdata-sections\" \\\n  -DCMAKE_EXE_LINKER_FLAGS=\"-fsanitize=address\" \\\n  -DCMAKE_SHARED_LINKER_FLAGS=\"-fsanitize=address\" \\\n  -DCMAKE_STATIC_LINKER_FLAGS=\"-fsanitize=address\" \\\n  -DCMAKE_MODULE_LINKER_FLAGS=\"-fsanitize=address\" \\\n  ...\n```\n\n**NOTE:** it is important to specify the `VCPKG_TARGET_TRIPLET` based on what platform and build configuration was used while compiling your dependencies with the sanitizers (look for the usage message that the script outputs at the end).\n\n## Dependency Versioning\n\nThe version of each dependency is influenced by the git checkout of vcpkg, contained in `vcpkg_info.txt`. Currently, the only way to upgrade is to push the commit in that file up, **_or_** to create (likely copy) a port definition for the required version and place it in our local `ports` ([overlay](https://github.com/microsoft/vcpkg/blob/master/docs/specifications/ports-overlay.md)) directory. While we do support multiple LLVM versions, it is not easy or well-supported (yet) to have different versions installed simultaneously.\n\nSee [the vcpkg docs](https://github.com/microsoft/vcpkg/blob/master/docs/examples/packaging-github-repos.md) for how to package a new library.\n\n### Updating Dependencies\n\nInstalling additional dependencies will not update any existing dependencies by default. We do not update/upgrade by default because this could cause unexpected rebuilds that could potentially take hours (in the case of LLVM). To update dependencies, pass the `--upgrade-ports` option to the build script along with the respective options affecting vcpkg triplet selection (like `--release`).\n\nYou must specify the exact package/ports you want to upgrade. If the port does not exist, this will fail.\n\n## Useful manual vcpkg commands\n\nSometimes it is useful to run vcpkg commands manually for testing a single package. Ideally, someone who wants to do this would read the [vcpkg documentation](https://github.com/microsoft/vcpkg/tree/master/docs), but below we list some commonly used commands. Inspecting the output of the build script will also show all of the vcpkg commands executed.\n\nThe following commands should be run from the root of this repo, and they do not apply if you have downloaded pre-built packages.\n\n### Installing\n\nRemember, you must know the triplet you would like to build with if you are using an existing installation after running the build script.\n\n```sh\n./vcpkg/vcpkg install --triplet=x64-osx-rel @overlays.txt --debug grpc --x-install-root=\u003c...\u003e/installed\n```\n\nThis command will \n* `install` the `grpc` package\n* using the `x64-osx-rel` triplet to only build x86-64 Release builds for Mac\n* in the context of `@overlays.txt`, which sets up vcpkg package paths using normal vcpkg commands (look at the file if you're interested)\n* tell vcpkg to print out `--debug` information\n* and use the `install-root` of `\u003c...\u003e/installed` where `\u003c...\u003e` is a path to your export directory or the local `vcpkg` repo.\n\n### Uninstalling\n\nRemember, you must know the triplet you would like to build with if you are using an existing installation after running the build script.\n\n```sh\n./vcpkg/vcpkg remove --triplet=x64-osx-rel @overlays.txt --debug grpc --x-install-root=\u003c...\u003e/installed\n```\n\nThis command will do similar things as the above command, except it will `remove` the package from the installation directory instead of installing.\n\n## LICENSING\n\nThis repo is under the Apache-2.0 LICENSE, unless where specified. See below.\n\nThe LLVM version port directories (ports/llvm-{15,16}) were initially copied from the upstream [vcpkg](https://github.com/microsoft/vcpkg) repo as a starting point. Eventually, we plan to submit the relevant patches for upstream when we have thoroughly tested these changes. More info can be found in the respective `LICENSE` and `NOTICE` files in those directories.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifting-bits%2Fcxx-common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifting-bits%2Fcxx-common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifting-bits%2Fcxx-common/lists"}