From 33a03465fde3130d246d5b69b16950a906d9d63d Mon Sep 17 00:00:00 2001 From: Daniel Larraz Date: Tue, 4 Feb 2025 13:51:28 -0600 Subject: [PATCH] cmake: Add option to build static binaries --- CMakeLists.txt | 10 +++++++++- configure.sh | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce0dc360..0e4ee603 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,15 @@ project (ethos_checker) # >> 2-valued: ON OFF # > for options where we don't need to detect if set by user (default: OFF) -option(ENABLE_ORACLES "Enable support for Oracles" ON) +option(BUILD_SHARED_LIBS "Build shared libraries and binary") +option(ENABLE_ORACLES "Enable support for Oracles" ON) + +if(NOT BUILD_SHARED_LIBS) + if(NOT APPLE) + set(CMAKE_EXE_LINKER_FLAGS "-static") + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a) +endif() set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) diff --git a/configure.sh b/configure.sh index 104f0a05..f53f142b 100755 --- a/configure.sh +++ b/configure.sh @@ -17,6 +17,12 @@ General options; --prefix=STR install directory --name=STR use custom build directory name (optionally: +path) + +Features: +The following flags enable optional features (disable with --no-