My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #4491 from facebook/cmake_root

[cmake] propose a root wrapper

authored by

Yann Collet and committed by
GitHub
dccd0df0 124a6f01

+72 -29
+16 -1
vendor/git/zstd-c/.github/workflows/cmake-tests.yml
··· 21 21 COMMON_CMAKE_FLAGS: "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DZSTD_BUILD_TESTS=ON" 22 22 23 23 jobs: 24 + # Basic cmake build using the root CMakeLists.txt 25 + # Provides a lightweight sanity check that the top-level project config builds 26 + # with the default Unix Makefiles generator driven purely through cmake commands 27 + cmake-root-basic: 28 + name: "CMake Root Build" 29 + runs-on: ubuntu-latest 30 + steps: 31 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0 32 + - name: Configure (Root) 33 + run: | 34 + cmake -S . -B cmake-build -DCMAKE_BUILD_TYPE=Release ${{ env.COMMON_CMAKE_FLAGS }} 35 + - name: Build (Root) 36 + run: | 37 + cmake --build cmake-build --config Release 38 + 24 39 # Ubuntu-based cmake build using make wrapper 25 40 # This test uses the make-driven cmake build to ensure compatibility 26 41 # with the existing build system integration 27 42 cmake-ubuntu-basic: 28 - name: "CMake Ubuntu Basic Build" 43 + name: "CMake build using make wrapper" 29 44 runs-on: ubuntu-latest 30 45 steps: 31 46 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0
+11 -10
vendor/git/zstd-c/.gitignore
··· 22 22 *.out 23 23 *.app 24 24 25 + # Build artefacts 26 + contrib/linux-kernel/linux/ 27 + projects/ 28 + bin/ 29 + .buckd/ 30 + buck-out/ 31 + build-* 32 + *.gcda 33 + cmakebuild/ 34 + cmake-build/ 35 + 25 36 # Test artefacts 26 37 tmp* 27 38 *.zst ··· 29 40 dictionary. 30 41 dictionary 31 42 NUL 32 - cmakebuild/ 33 43 install/ 34 - 35 - # Build artefacts 36 - contrib/linux-kernel/linux/ 37 - projects/ 38 - bin/ 39 - .buckd/ 40 - buck-out/ 41 - build-* 42 - *.gcda 43 44 44 45 # IDE 45 46 .clang_complete
+11
vendor/git/zstd-c/CMakeLists.txt
··· 1 + cmake_minimum_required(VERSION 3.10) 2 + 3 + # Thin wrapper so `cmake -S .` behaves like `cmake -S build/cmake`. 4 + # Policy lives in build/cmake; keep parent project language-less. 5 + project(zstd-superbuild LANGUAGES NONE) 6 + 7 + if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) 8 + message(FATAL_ERROR "In-source builds are not supported. Specify -B <build-dir>.") 9 + endif() 10 + 11 + add_subdirectory(build/cmake)
+25 -18
vendor/git/zstd-c/README.md
··· 120 120 121 121 ## Build instructions 122 122 123 - `make` is the officially maintained build system of this project. 124 - All other build systems are "compatible" and 3rd-party maintained, 125 - they may feature small differences in advanced options. 126 - When your system allows it, prefer using `make` to build `zstd` and `libzstd`. 123 + `make` is the main build system of this project. 124 + It is the reference, and other build systems are periodically updated to stay compatible. 125 + However, small drifts and feature differences can be present, since perfect synchronization is difficult. 126 + For this reason, when your build system allows it, prefer employing `make`. 127 127 128 128 ### Makefile 129 129 130 130 Assuming your system supports standard `make` (or `gmake`), 131 - invoking `make` in root directory will generate `zstd` cli in root directory. 132 - It will also create `libzstd` into `lib/`. 131 + just invoking `make` in root directory generates `zstd` cli at root, 132 + and also generates `libzstd` into `lib/`. 133 133 134 134 Other standard targets include: 135 - - `make install` : create and install zstd cli, library and man pages 136 - - `make check` : create and run `zstd`, test its behavior on local platform 135 + - `make install` : install zstd cli, library and man pages 136 + - `make check` : run `zstd`, test its essential behavior on local platform 137 137 138 138 The `Makefile` follows the [GNU Standard Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html), 139 139 allowing staged install, standard compilation flags, directory variables and command variables. ··· 144 144 145 145 ### cmake 146 146 147 - A `cmake` project generator is provided within `build/cmake`. 148 - It can generate Makefiles or other build scripts 149 - to create `zstd` binary, and `libzstd` dynamic and static libraries. 147 + A `cmake` project generator is available for generating Makefiles or other build scripts 148 + to create the `zstd` binary as well as `libzstd` dynamic and static libraries. 149 + The repository root now contains a minimal `CMakeLists.txt` that forwards to `build/cmake`, 150 + so you can configure the project with a standard `cmake -S .` invocation, 151 + while the historical `cmake -S build/cmake` entry point remains fully supported. 152 + 153 + ```bash 154 + cmake -S . -B build-cmake 155 + cmake --build build-cmake 156 + ``` 150 157 151 158 By default, `CMAKE_BUILD_TYPE` is set to `Release`. 152 159 ··· 156 163 To perform a Fat/Universal2 build and install use the following commands: 157 164 158 165 ```bash 159 - cmake -B build-cmake-debug -S build/cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h;arm64" 166 + cmake -S . -B build-cmake-debug -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h;arm64" 160 167 cd build-cmake-debug 161 168 ninja 162 169 sudo ninja install ··· 198 205 ### Visual Studio (Windows) 199 206 200 207 Going into `build` directory, you will find additional possibilities: 201 - - Projects for Visual Studio 2005, 2008 and 2010. 208 + - Projects for Visual Studio 2008 and 2010. 202 209 + VS2010 project is compatible with VS2012, VS2013, VS2015 and VS2017. 203 210 - Automated build scripts for Visual compiler by [@KrzysFR](https://github.com/KrzysFR), in `build/VS_scripts`, 204 211 which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution. 212 + - It is now recommended to generate Visual Studio solutions from `cmake` 205 213 206 214 ### Buck 207 215 ··· 210 218 211 219 ### Bazel 212 220 213 - You easily can integrate zstd into your Bazel project by using the module hosted on the [Bazel Central Repository](https://registry.bazel.build/modules/zstd). 221 + You can integrate zstd into your Bazel project by using the module hosted on the [Bazel Central Repository](https://registry.bazel.build/modules/zstd). 214 222 215 223 ## Testing 216 224 ··· 221 229 222 230 ## Status 223 231 224 - Zstandard is currently deployed within Facebook and many other large cloud infrastructures. 225 - It is run continuously to compress large amounts of data in multiple formats and use cases. 226 - Zstandard is considered safe for production environments. 232 + Zstandard is deployed within Meta and many other large cloud infrastructures, 233 + to compress humongous amounts of data in various formats and use cases. 234 + It is also continuously fuzzed for security issues by Google's [oss-fuzz](https://github.com/google/oss-fuzz/tree/master/projects/zstd) program. 227 235 228 236 ## License 229 237 ··· 232 240 ## Contributing 233 241 234 242 The `dev` branch is the one where all contributions are merged before reaching `release`. 235 - If you plan to propose a patch, please commit into the `dev` branch, or its own feature branch. 236 243 Direct commit to `release` are not permitted. 237 244 For more information, please read [CONTRIBUTING](CONTRIBUTING.md).
+9
vendor/git/zstd-c/build/cmake/README.md
··· 7 7 8 8 ## How to build 9 9 10 + You can configure the project from the repository root thanks to the forwarding 11 + `CMakeLists.txt`: 12 + ```sh 13 + cmake -S . -B build-cmake 14 + cmake --build build-cmake 15 + ``` 16 + The historical workflow that starts configuration from `build/cmake` continues 17 + to work as described below. 18 + 10 19 As cmake doesn't support command like `cmake clean`, it's recommended to perform an "out of source build". 11 20 To do this, you can create a new directory and build in it: 12 21 ```sh