The only thing we know ever triggered this is old macOS versions,
there's no need to use it for everyone else.
Since this uses try_run it breaks when cross-compiling, which
shouldn't be a common thing on macOS.
Fixes#7737
This was a typo. CMake doesn't take comma-separated arguments, but if
you do add the comma it tends to work, because it just takes that
comma as part of the string. So if it takes a directory to work in,
that it will then create, and you pass
${CMAKE_CURRENT_BINARY_DIR},
well, that might just create a "build," directory.
It's not entirely clear why the existing check does not work, but it seems to pass on clang++ even without -latomic, but causes the fish build to fail later.
Confirmed that with this change, g++ does not use -latomic, while clang++ does, and fish builds fine with both.
When CMake's own curses logic fails to find curses/ncurses, we fall back to
pkg-config and manually link the required libraries. Some platforms (RHEL 6,
see #6587) require CURSES_EXTRA_LIBRARY=tinfo, so we link against libtinfo
if it's found but are happy to continue without it if it doesn't exist.
Closes#6587
- Define it before the headers so they can pick the variadic tparm
prototype.
- We need a TPARM_VARARGS define, add it to config_cmake.h.
- Move & adjust comment - put it near the code, and mentiont that
NetBSD curses doesn't need the kludge.
Now variadic tparm is used on NetBSD instead of the Solaris kludge.
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).
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.
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.
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.
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.
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.
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).
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.
Just sets locale to "C" (because that's the only one we need), does
wcstod and resets the locale.
No idea why uselocale(loc) failed for me, but it did.
Fixes#5407.
The non-ncurses version of term.h requires that curses.h be first
included. Only very recent versions of CMake include a LANGUAGE
option to CHECK_INCLUDE_FILES, so we aren't using it and specifying
CXX here..
CheckFunctionExists checks for C linkage only, and recommends the use of
CheckSymbolExists in the documentation. This improves the detection of
C++ features, as opposed to C features.