`add_compile_options()` adds options to all compilers CMake can invoke, including ASM. The format of this warning flag causes MASM to fail if the option is specified. This limits specifying the warning suppression to just C and C++.
Just wire things up to make the project buildable
on LoongArch64.
opensslconf.h is taken form riscv64 folder as is,
and is the same as on some other 64 bit architectures.
Refs: https://github.com/libressl/portable/issues/1123
Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>
FreeBSD's libc has a stub implementation of pthread_once() that returns
ENOSYS and doesn't seem to call the init routine. You need to link with
pthread for this to work. This PR does this and fixes regress failures
for CMake builds on this platform. This likely never worked.
As of CMake 3.20, this causes the files to be built _as_ C, instead of
just with a C compiler. This also properly specifies the languages in
the project call.
There are a few exceptions. Some require _GNU_SOURCE, some are in the
weird strings.h header, some are probably too new to be found in the
standard locations.
Fixes#1077
strlcpy and strlcat Emscripten implementations cause ASAN errors. This commit disables strlcpy and strlcat detection and uses the compat implementations instead.
Collapse the same if condition blocks into one block. Include the uninstall rule when building install rules; if there was no install, shouldn't need uninstall (for this build; a previous build that was installed would have an uninstall rule)
Before this patch `NDEBUG` was force-disabled, preventing a build with
debug asserts disabled.
After this patch `NDEBUG` works again when passed as a custom build
option, e.g.: `-DCMAKE_C_FLAGS=-DNDEBUG`
Previously submitted as #988, which was merged, but the commit vanished
from master and ended up missing from both 3.8.3 and 3.9.0 releases.
Visual studio does not define __BYTE_ORDER__ so all architectures
were detected as LITTLE_ENDIAN since both __BYTE_ORDER__ and
__ORDER_LITTLE_ENDIAN__ would evaluate to 0 and compare equal. This
updates the checks to use CMakes detection of endianness, with a hard
error, if this also fails.
This makes it accept values consistently. Before this patch
mingw-w64, Apple and SunOS did not accept a CPU if it had
a suffix or prefix (e.g. a triplet), while other targets did.
- `-DCPPFLAGS`: probably a copy-paste typo from the initial CMake
commit.
- `-DNO_CRYPT`: `NO_CRYPT` is no longer used in the source and this
macro is no longer set by autotools.