diff --git a/CMakeLists.txt b/CMakeLists.txt index cbcb78652..9f3597ba3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}") endif() +# Error out when linking statically, it doesn't work. +if (CMAKE_EXE_LINKER_FLAGS MATCHES ".*-static.*") + message(FATAL_ERROR "Fish does not support static linking") +endif() + # Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support. # Rationale in https://github.com/ninja-build/ninja/issues/814 if (CMAKE_GENERATOR STREQUAL "Ninja" AND