Skip to content

Commit

Permalink
abort on CMake install w/ clear error
Browse files Browse the repository at this point in the history
This updates the librustls CMakeLists.txt to abort on install. It's only
intended to be used for the C examples, which we _don't_ want anyone to
install anywhere!

Use cargo capi for librustls, not cmake.

```
$ cmake --install build
-- Install configuration: "Release"
CMake Error at build/cmake_install.cmake:46 (message):
  librustls installation via CMake is not supported.  Use 'cargo capi
  install' instead.

  See:
  https://github.com/rustls/rustls-ffi?tab=readme-ov-file#build-rustls-ffi
```
  • Loading branch information
cpu committed Jan 20, 2025
1 parent 32120bb commit 5a3852b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions librustls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ cmake_minimum_required(VERSION 3.15)

project(rustls-ffi)

install(
CODE
"message(FATAL_ERROR
\"librustls installation via CMake is not supported. Use 'cargo capi install' instead.\n\"
\"See: https://github.com/rustls/rustls-ffi?tab=readme-ov-file#build-rustls-ffi\")"
)

# Use `cmake -LH $BUILD_DIR` to see all options/help.
# Use `cmake --build $BUILD_DIR --target help` to see all targets.

Expand Down

0 comments on commit 5a3852b

Please sign in to comment.