Commit Graph

113 Commits

Author SHA1 Message Date
David Adam
8ff0c351a9 vendor_*.d: also create these directories in the prefix 2020-01-25 16:12:20 +08:00
David Adam
81306d3b30 vendor_*.d: include /usr/local by default as "extra" directory
Closes #5029.
2020-01-25 16:12:20 +08:00
Johannes Altmanninger
e3782603ec Load vendor configuration from $XDG_DATA_DIRS/vendor_*.d
$XDG_DATA_DIRS/vendor_{completions,conf,functions}.d
Additionally, CMake variables extra_{completions,conf,functions}dir are
appended, if they are not already contained in $XDG_DATA_DIRS.

If XDG_DATA_DIRS is not defined, we fall back to

$__fish_datadir/vendor_completions.d:${extra_completionsdir}

for completions. Same for conf and functions.
2020-01-12 16:12:41 +01:00
David Adam
5df84c1998 cmake: use correct variable for C++ compiler flags
Broken in 8ca936aea6
2020-01-02 22:08:59 +08:00
David Adam
8ca936aea6 cmake: use C++ extension options when checking features
This matches the CMake default of extensions turned on.
2019-12-23 22:26:57 +08:00
David Adam
4d325dcd7a cmake: tidy up adding C++11 compile flags
Two blocks of code were trying to do the same thing in different ways;
standardise on one, and only add the compile flags if CMake won't do it
itself (policy CMP0067).
2019-12-23 22:26:57 +08:00
ridiculousfish
82baf74785 Attempt to fix the build
Move the CMake changes down in the file after the FIND_PACKAGE calls.
2019-12-22 12:31:14 -08:00
ridiculousfish
87854c81f5 Allow C++ standard to be passed to CHECK_CXX_SOURCE_COMPILES
Work around the issue in CMake where C++ standard doesn't get propagated
to CHECK_CXX_SOURCE_COMPILES. Also correctly check for std::make_unique;
the define was missing from the config.h header.
2019-12-22 12:07:46 -08:00
David Adam
45633f4a54 cmake: force C++11 in CHECK_CXX_SOURCE_COMPILES for atomic
GCC 4.8 requires the use of `-std=gnu++11` or similar to enable atomic
features. However, older versions of CMake don't pick up the
project-wide target for C++11 when building the configure check targets.
Although CMake policy 0067 could be set to NEW to enable this, it only
exists on CMake 3.8 and newer, while many of our supported platforms are
on an older version.
2019-12-21 22:00:22 +08:00
David Adam
8f2f3b648f cmake: check for 64-bit atomic operations directly
780bac671f did not actually successfully
compile on any platforms, leading to -latomic always being added
(including on platforms it does not exist on).

Work on #5865.
2019-12-20 23:47:46 +08:00
David Adam
780bac671f cmake: add -latomic on platforms that need it for 64-bit atomic operations
Closes #5865.
2019-12-20 23:00:06 +08:00
David Adam
3365410bde cmake: only define test policy on old versions
CMP0037 only reserves the test name if CTest is included on newer versions of CMake.

This commit fixes a build warning.
2019-11-01 20:58:40 +08:00
Johannes Altmanninger
b52d3d641e Fix clean build of sphinx-docs 2019-10-20 08:15:58 +02:00
Johannes Altmanninger
aa1bf9f277 sphinx: honor changes in static html assets
Also fix custom.css.
2019-10-19 14:52:24 +02:00
David Adam
8e0aa03c4a cmake: sphinx-manpages requires fish_indent for version number
Fixes issue #6216.

Problem introduced in 3b8505bebe.
2019-09-21 16:32:24 +08:00
David Adam
a10547018e cmake: don't install realpath manpage on non-macOS systems 2019-09-17 20:54:11 +08:00
ridiculousfish
97c4794424 Properly mark tests_dir as a dependency of test_prep
Allows for running a subset of tests immediately after build system config.
2019-07-21 11:21:50 -07:00
Fabian Homborg
cdbd0891f7 Remove invocation tests
These are now all performed by littlecheck, so there's no need for the
entire target anymore.
2019-06-25 22:31:45 +02:00
David Adam
8f3a0dcc8b cmake: harmonise argument to foreach/endforeach
Fixes a warning introduced in 40d91b7e77.
2019-06-23 16:00:40 +08:00
ridiculousfish
40d91b7e77 Allow running test suites independently
This makes test_low_level, test_interactive, test_invocation, and
test_fishscript independent. This allows running a smaller subset of tests.

To prevent all tests running in parallel, we also have new targets
serial_test_low_level, serial_test_interactive, etc. which have the
dependency chain that enforces serial execution.
2019-06-22 14:17:10 -07:00
ridiculousfish
db703c273d Remove some stale comments from Tests.cmake
These comments were used to refer back to the autotools build, but the
autotools build is no more and CMake is now the source of truth.
2019-06-22 13:12:49 -07:00
ridiculousfish
fcf0593dfb Port printf tests to littlecheck and teach the tester how to run it
This adds support for .check files inside the tests directory. .check
files are tests designed to be run with littlecheck.

Port printf test to littlecheck and remove the printf.in test.
2019-06-16 14:10:41 -07:00
David Adam
665ae3787a Switch to runtime check for /proc/self/stat
Removes a compile-time check that may have affected cross-compilation.

Work on #1067.
2019-04-30 16:23:28 +08:00
ridiculousfish
f35f2fe110 Mark the benchmark as using the terminal
Prevents buffering all output from the command.
2019-04-13 12:40:12 -07:00
ridiculousfish
c39950e49a Add benchmark target to CMake
This adds a benchmark target to CMake to run the new benchmarks.

example: ninja benchmark
2019-04-10 14:35:59 -07:00
ridiculousfish
b6555a0dc4 Add print-rusage-self to fish
This adds an option --print-rusage-self to the fish executable. When set,
this option prints some getrusage stats to the console in a human-readable
way. This will be used by upcoming benchmarking support.
2019-04-10 14:33:45 -07:00
ridiculousfish
93cc99d6d0 Teach CMake to tell Sphinx where fish_indent is 2019-04-08 19:11:10 -07:00
ridiculousfish
5b2c741f6c Add fish_indent_lexer.py
This is a pygments lexer that shells out to fish_indent
2019-04-08 19:09:53 -07:00
ridiculousfish
23d88e0e03 Add fish_test_helper executable
In tests we would like to arrange for an executable to invoke certain
system calls, e.g. to claim or relinquish control of the terminal. This is
annoying to do portably via e.g. perl. fish_test_helper is a little
program where we can add custom commands to make it act in certain ways.
2019-04-07 09:20:19 -07:00
Fabian Homborg
bfb61879cd Do create installation directories that already exist
Reverts 71329a250b.

That tried to fix problems with pkgconfig by not recreating it.
Instead, use the function we already have for not trying too hard to
create a directory.

Fixes #5735.
2019-03-12 18:50:45 +01:00
David Adam
08fd8b6472 cmake: fix prebuilt documentation detection and installation 2019-03-04 22:06:09 +08:00
David Adam
73d9f80772 cmake: drop obsolete paths for prebuilt documentation 2019-02-28 22:04:54 +11:00
David Adam
9acfe0261b cmake: install system manpath manpages
The build path of these files moved under Sphinx.
2019-02-28 22:03:57 +11:00
Fabian Homborg
3674efad0b Fix manpage directory
This installed files in man/ directly, instead of in man/man1/, so
they weren't installed.

See #5696.
2019-02-25 21:16:42 +01:00
Fabian Homborg
0e82fb8c47 Install sphinx files
Sphinx put the files into sphinx-root, which wasn't being installed.

Instead, use user_doc again, which we already used before.

Belongs to #5696.
2019-02-25 21:05:02 +01:00
ridiculousfish
4da38df43b Remove last vestiges of Doxygen from Docs.cmake 2019-02-24 19:02:39 -08:00
ridiculousfish
2ec33be90f CMake BUILD_DOCS option to look for sphinx instead of Doxygen 2019-02-24 18:58:25 -08:00
ridiculousfish
c46f02e01e Initial sphinx file import 2019-02-24 18:15:23 -08:00
David Adam
d44308388f cmake: use the check state stack for __nl_msg_cat_cntr checks 2019-02-19 21:35:30 +08:00
David Adam
7200f7ff4a Revert "Drop hard requirement on explicit -lpthread support"
This reverts commit b402b635a9f7466616cef6e2b9cfd55a6e7068c5; as discussed in #5512 it is not
required.
2019-02-12 22:30:53 +08:00
ridiculousfish
b952606430 Teach CMake Mac App build to dynamically derive the version
Populate CFBundleShortVersionString with the fish version from
git_version_gen.sh. Note this happens at build generation time, not at
build time.
2019-02-05 22:14:43 -08:00
ridiculousfish
e0396d8ef8 CMake support for building Mac app 2019-02-05 22:14:43 -08:00
Mahmoud Al-Qudsi
462cb6044c Use standard __CYGWIN__ define for Cygwin detection 2019-01-21 20:06:16 -06:00
Mahmoud Al-Qudsi
16a94db702 Check for -Werror=unguarded_availability support before forcing it
The compiler flag `-Werror=unguarded_availability` was hard-coded for
macOS, but is not supported by GCC on macOS 10.10 (Yosemite). Test for
support with CHECK_CXX_COMPILER_FLAG before forcing it.
2019-01-10 20:03:38 -06:00
Mahmoud Al-Qudsi
b402b635a9 Drop hard requirement on explicit -lpthread support
Closes #5512
2019-01-10 20:03:38 -06:00
Mahmoud Al-Qudsi
4f196eef64 Bypass mutually exclusive CMake checks
There are some redundant CMake checks, in the sense that they are either
not needed or cannot possibly match if a previous check already passed.
2019-01-04 14:46:36 -06:00
Mahmoud Al-Qudsi
5196a42165 Prevent CMake configure checks for affecting future checks
Using CMAKE_PUSH_CHECK_STATE/CMAKE_POP_CHECK_STATE to prevent CMake
checks from permanently altering the environment used by future checks.
2019-01-04 14:30:14 -06:00
Mahmoud Al-Qudsi
490432c177 Globally set the _GNU_SOURCE define for CMake configuration checks 2019-01-04 14:18:02 -06:00
Mahmoud Al-Qudsi
380bae80bf Fix wcstod_l detection under Linux
This was broken in a8eb02f9f5 when the
detection was corrected for FreeBSD. This patch makes the detection work
for both Linux and FreeBSD instead of one or the other (tested).
2019-01-02 19:07:53 -06:00
Mahmoud Al-Qudsi
7af0cad23d Fall back to CMake's pkg-config-based search for curses
CMake seems to have trouble finding libraries from multiarch packages
that do not have the compatibility symlink installed to the
arch-independent library directory. Users must either manually supply
the path to the library in question via command-line parameters or we
can fall back to CMake's alternate method of finding packages based off
of pkg-config rather than using the hard-coded `FindCurses` CMake module
specific to the CMake version/distribution installed.
2019-01-02 18:38:55 -06:00