Skip to content

Commit 721a360

Browse files
committed
cmake: Remove a bunch of unnecessary code
We are no longer C++, we no longer support xcode Note: This will remove a warning "DO NOT EDIT" comment from __fish_build_paths.fish, but that's unnecessary. The file is typically in /usr or another package-manager-owned location, so people don't typically edit it. And if it did we don't actually *care*, it'll work fine.
1 parent 33a7172 commit 721a360

File tree

3 files changed

+0
-85
lines changed

3 files changed

+0
-85
lines changed

CMakeLists.txt

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# CMake 3.15 is required to support Corrosion
21
# CMake 3.19 is needed for file(REAL_PATH)
32
cmake_minimum_required(VERSION 3.19)
43

@@ -33,43 +32,6 @@ include(cmake/PCRE2.cmake)
3332

3433
include(cmake/Rust.cmake)
3534

36-
# Error out when linking statically, it doesn't work.
37-
if (CMAKE_EXE_LINKER_FLAGS MATCHES ".*-static.*")
38-
message(FATAL_ERROR "Fish does not support static linking")
39-
endif()
40-
41-
# Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support.
42-
# Rationale in https://github.com/ninja-build/ninja/issues/814
43-
if (CMAKE_GENERATOR STREQUAL "Ninja" AND
44-
((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) OR
45-
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) OR
46-
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)))
47-
add_compile_options(-fdiagnostics-color=always)
48-
endif()
49-
50-
# Enable a whole bunch of warnings, but turn off:
51-
# - comment because we use a bunch of those, and they're not really all that harmful.
52-
# - address, because that occurs for our mkostemp check (weak-linking requires us to compare `&mkostemp == nullptr`).
53-
add_compile_options(-Wall -Wextra -Wno-comment -Wno-address)
54-
55-
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
56-
add_compile_options(-Wunused-template -Wunused-local-typedef -Wunused-macros)
57-
endif()
58-
59-
# Disable exception handling.
60-
add_compile_options(-fno-exceptions)
61-
62-
# Hide the CMake Rules directories in Xcode projects.
63-
source_group("CMake Rules" REGULAR_EXPRESSION "^$")
64-
65-
# Put source and header files at top level under targets.
66-
source_group("Source Files" REGULAR_EXPRESSION ".*\\.cpp")
67-
source_group("Header Files" REGULAR_EXPRESSION ".*\\.h")
68-
source_group("Builtins" "builtins/")
69-
70-
# Support folders.
71-
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
72-
7335
# Work around issue where archive-built libs go in the wrong place.
7436
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
7537

@@ -89,9 +51,6 @@ get_filename_component(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH)
8951
add_definitions(-DCMAKE_BINARY_DIR="${REAL_CMAKE_BINARY_DIR}")
9052
add_definitions(-DCMAKE_SOURCE_DIR="${REAL_CMAKE_SOURCE_DIR}")
9153

92-
# Enable thread-safe errno on Solaris (#5611)
93-
add_definitions(-D_REENTRANT)
94-
9554
# cargo needs to be rerun when the sources change.
9655
# This is imperfect, but the ninja generator really wants to
9756
# not run cargo, so we need to tell it *something*
@@ -150,14 +109,5 @@ include(cmake/Install.cmake)
150109
# Mac app.
151110
include(cmake/MacApp.cmake)
152111

153-
# ThreadSanitizer likes to muck with signal handlers, which interferes
154-
# with fish_test_helper printing the ignored signal mask.
155-
# Ensure fish_test_helper does not use TSan.
156-
# Note the environment var is CXXFLAGS, but the CMake var is CMAKE_CXX_FLAGS.
157-
if (CMAKE_CXX_FLAGS MATCHES ".*-fsanitize=thread.*")
158-
target_compile_options(fish_test_helper PRIVATE "-fno-sanitize=all")
159-
target_link_libraries(fish_test_helper "-fno-sanitize=all")
160-
endif()
161-
162112
include(FeatureSummary)
163113
feature_summary(WHAT ALL)

cmake/Install.cmake

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
2-
# -DPREFIX=L"${CMAKE_INSTALL_PREFIX}"
3-
# -DDATADIR=L"${CMAKE_INSTALL_FULL_DATADIR}"
4-
# -DSYSCONFDIR=L"${CMAKE_INSTALL_FULL_SYSCONFDIR}"
5-
# -DBINDIR=L"${CMAKE_INSTALL_FULL_BINDIR}"
6-
# -DDOCDIR=L"${CMAKE_INSTALL_FULL_DOCDIR}")
7-
81
set(CMAKE_INSTALL_MESSAGE NEVER)
92

103
set(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/fish ${CMAKE_CURRENT_BINARY_DIR}/fish_indent ${CMAKE_CURRENT_BINARY_DIR}/fish_key_reader)
@@ -19,11 +12,6 @@ file(RELATIVE_PATH rel_datadir ${CMAKE_INSTALL_PREFIX} ${datadir})
1912

2013
set(docdir ${CMAKE_INSTALL_DOCDIR})
2114

22-
# Comment at the top of some .in files
23-
set(configure_input
24-
"This file was generated from a corresponding .in file.\
25-
DO NOT MANUALLY EDIT THIS FILE!")
26-
2715
set(rel_completionsdir "fish/vendor_completions.d")
2816
set(rel_functionsdir "fish/vendor_functions.d")
2917
set(rel_confdir "fish/vendor_conf.d")

cmake/gettext.cmake

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,7 @@ include(FeatureSummary)
44

55
option(WITH_GETTEXT "translate messages if gettext is available" ON)
66
if(WITH_GETTEXT)
7-
if(APPLE)
8-
# Fix for https://github.com/fish-shell/fish-shell/issues/5244
9-
# via https://gitlab.kitware.com/cmake/cmake/-/issues/18921
10-
set(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
11-
set(CMAKE_FIND_FRAMEWORK NEVER)
12-
endif()
13-
find_package(Intl QUIET)
147
find_package(Gettext)
15-
if(GETTEXT_FOUND)
16-
include_directories(${Intl_INCLUDE_DIR})
17-
endif()
18-
if(APPLE)
19-
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
20-
unset(CMAKE_FIND_FRAMEWORK_OLD)
21-
endif()
228
endif()
239
add_feature_info(gettext GETTEXT_FOUND "translate messages with gettext")
2410

@@ -34,12 +20,3 @@ if(GETTEXT_FOUND)
3420
endforeach()
3521
set(CMAKE_FOLDER)
3622
endif()
37-
38-
include(CMakePushCheckState)
39-
cmake_push_check_state()
40-
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Intl_INCLUDE_DIR})
41-
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Intl_LIBRARIES})
42-
# libintl.h can be compiled into the stdlib on some GLibC systems
43-
if(Intl_FOUND AND Intl_LIBRARIES)
44-
set(LIBINTL_INCLUDE "#include <libintl.h>")
45-
endif()

0 commit comments

Comments
 (0)