mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
cmake: Error out with "-static"
I'm not entirely sure this *has* to be given via CMAKE_EXE_LINKER_FLAGS, but this would have stopped at least one person from trying. Static linking 1. does not work at the moment, 2. is not *useful*. You don't get a single-file fish you can just copy somewhere because you're missing our functions. On glibc systems you also can't statically link glibc. Given all that, it does not appear to be worth putting in any effort to make it work (if it's possible at all). See #7947.
This commit is contained in:
parent
3cccb77b52
commit
981a07d4c7
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue