From a362bdc91fde52ea5970eea4a2e7e9eda8a7b796 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Mon, 20 Jan 2025 17:53:50 -0500 Subject: [PATCH] abort on CMake install w/ clear error 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 ``` --- librustls/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/librustls/CMakeLists.txt b/librustls/CMakeLists.txt index 6384bf01..eaa84806 100644 --- a/librustls/CMakeLists.txt +++ b/librustls/CMakeLists.txt @@ -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.