CMakeLists.txt

Branch


Log

Author Commit Date CI Message
Brent Cook be49b81c 2025-10-13T22:33:29 automatically disable assembly on arm32 Darwin
Brent Cook 659e87fe 2025-10-07T03:49:29 move ftruncate to common libcompat for tests
Un1q32 d580acbc 2025-08-01T13:15:43 check for resolv.h and arpa/nameser.h
Jim B 5c205f4b 2025-07-06T15:48:55 Remove applying flag to C++ code
Jim B f4d8b535 2025-07-06T09:32:49 Limit usage of warning flags to C and C++ `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++.
Brent Cook 1df6b52b 2025-06-05T15:19:32 should be no need to force disabling asm anymore
Brent Cook aeadd0ae 2025-06-04T17:53:34 adjust CMAKE_SYSTEM_PROCESSOR on Windows builds Match CMAKE_GENERATOR_PLATFORM so that cross-builds work properly. Otherwise, we're just targeting the build system anyway.
Brent Cook 21f4bd2a 2025-06-03T05:08:04 Land #1175, Add ISC copyright headers, add explicit COPYING to LibreSSL portable tree
Brent Cook 5d9229b1 2025-06-01T17:24:24 adjust incorrect commit years Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
Brent Cook c51665d4 2025-06-01T08:11:22 add copyright headers to Cmake files based on original committer and date
Theo Buehler 5011fa2a 2025-05-24T21:24:26 remove arm perlasm tendrils
Theo Buehler 2a63bda5 2025-04-12T17:21:01 Drop -fno-common
Theo Buehler 033df1bf 2025-04-12T17:13:26 Switch to add_compile_options
Theo Buehler fcd87511 2025-04-12T17:13:26 Land #1046 - Fix -Wno-pointer-sign for C++
Ivan A. Melnikov 031c2f17 2025-04-10T17:09:19 Basic loongarch64 support 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>
Mustafa Gökçe 441cacf1 2025-04-07T13:30:02 Fix no pointer sign warning on C++ compilers
Theo Buehler bf808ea0 2024-12-19T20:24:33 Provide getdelim and getline compat shims These are portable implementations from NetBSD that are needed on Windows and perhaps some other platforms with the new versions of the mlkem tests.
Don Olmstead 1996dbc0 2024-11-13T12:05:09 Disable additional MSVC warnings Append additional MSVC warnings to `MSVC_DISABLED_WARNINGS_LIST`. Disable warnings for specific files using `COMPILE_OPTIONS`.
Viktor Szakats 4f20970a 2024-10-29T15:27:34 cmake: use `CMAKE_INSTALL_SYSCONFDIR` Replace `${CMAKE_INSTALL_PREFIX}/etc` with `${CMAKE_INSTALL_SYSCONFDIR}`. It makes the install step honor the `--prefix` option. Fixes #1118
Theo Buehler 91658ff3 2024-10-15T08:44:14 Fix CMake build on FreeBSD 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.
Brent Cook bd997837 2024-10-08T04:47:26 don't override language property for ASM files as C 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.
Theo Buehler 69c26f31 2024-10-02T12:35:23 fix syslog_r and pipe2 detection
Theo Buehler 59f21d48 2024-10-02T05:35:50 Fix syslog_r detection
Theo Buehler 415eb81e 2024-10-02T04:41:23 Revert "bump minimum CMake version for DLL_NAME_WITH_SOVERSION" This reverts commit 5feccf86658d09b917c005bfb43191dd38f38c83.
Brent Cook c169d7e6 2024-10-01T04:00:46 Land #1079, Switch to check_symbol_exists() for simple cases
Brent Cook c04ca241 2024-10-01T03:56:09 Land #1084, Append version to dll on CMake
Brent Cook 5feccf86 2024-10-01T03:23:09 bump minimum CMake version for DLL_NAME_WITH_SOVERSION
Yang Kun d718a268 2024-08-21T22:45:24 Fix includedir on CMake
Theo Buehler 1ff9793d 2024-08-02T22:18:05 Switch to check_symbol_exists() in simplest cases 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
Viktor Szakats 5c978c4e 2024-08-07T18:31:32 cmake: replace `CMAKE_SYSTEM_PROCESSOR` with `HOST_*` Follow-up to e99a7dd931065e4b3535cb3e2e8bee8c3db0afaf #1075
rfl890 becbdfbf 2024-08-02T15:10:26 Update CMakeLists.txt
OPNA2608 e6c7de3f 2024-07-19T11:41:46 CMakeLists.txt: Fix HOST variable for ppc64 The code here defined HOST_PPC64, but the rest of the build system expects HOST_POWERPC64.
MoustaphaSaad 71e574aa 2024-06-10T21:31:42 use compat implementations of strlcpy and strlcat strlcpy and strlcat Emscripten implementations cause ASAN errors. This commit disables strlcpy and strlcat detection and uses the compat implementations instead.
Theo Buehler f9874d49 2024-05-25T08:56:45 Remove timegm() compat Now that all uses of gmtime_r() and timegm() have been converted to OPENSSL_gmtime() and OPENSSL_timegm(), this is no longer needed.
Jim B fdfbde78 2024-04-07T20:45:02 Update CMakeLists.txt Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
Jim B 9f64e1d1 2024-04-06T12:17:32 Update CMakeLists.txt 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)
Viktor Szakats 6664303a 2024-03-11T15:31:14 cmake: disable default NDEBUG differently 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.
Brent Cook 4e25dc4f 2024-02-12T03:34:40 Land #989 cmake: disable ASM for Windows ARM64
Brent Cook db3ab167 2024-02-12T03:00:53 Land #998, Windows: Improve check for endianness when using Visual Studio
Christian Andersen 5bd332ec 2024-02-04T19:16:14 Windows: Improve the check for endianness when using Visual Studio. 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.
Christian Andersen 78970524 2024-02-04T19:26:00 Windows: Don't set -Wall when compiling with Visual Studio. As it enables a lot of spammed warnings that are not part of W4. This reduces the warnings a lot when compiling LibreSSL in CLion for me.
Viktor Szakats bebf6378 2024-01-02T03:08:14 cmake: disable ASM for Windows ARM64 With ASM support the builds either exit with an assert or hang (with asserts disabled).
Theo Buehler 14639912 2023-12-20T16:09:18 Fix timingsafe memcmp detection
Viktor Szakats 17cf672a 2023-12-14T13:43:04 cmake: limit some macros to mingw Syncing this up with autotools. Also use the built-in `MINGW` variable.
Viktor Szakats 906e10ea 2023-12-14T04:59:04 try fixing missing tls-compat for tests
Viktor Szakats 84895087 2023-12-14T03:36:09 cmake: stop exporting compat functions
Viktor Szakats 0de236a7 2023-12-11T16:21:30 cmake: auto-detect `strtonum` Notice that just like in autotools, this detection also doesn't take into account the targeted OS version. Meaning it detects `strtonum` even if targeting e.g. macOS older than release v11 Big Sur (which introduced this funcitions), if the SDK declares it. Wrong detection will either cause a binary broken on older macOS and/or trigger compiler warnings. Ref: https://github.com/libressl/portable/issues/928#issuecomment-1850178282 Ref: https://github.com/libressl/portable/issues/928#issuecomment-1850276298 Prerequisite: https://github.com/libressl/portable/issues/928#issuecomment-1850356408
Brent Cook b16146e0 2023-11-07T19:27:58 Land #938, cmake: simplify if expressions, accept CPU values more consistently
Viktor Szakats abf3be5c 2023-11-07T17:00:56 always check `CMAKE_SYSTEM_PROCESSOR` with `MATCHES` 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.
Viktor Szakats 27486b12 2023-11-07T16:55:52 simplify `MATCHES`/`STREQUAL` syntax
Viktor Szakats 557b5a19 2023-11-07T14:39:16 cmake: stop passing unused C macros - `-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.
Viktor Szakats 690b98fe 2023-11-07T11:56:33 cmake: fix arm64 to not trigger armv4 ASM Reported here: https://github.com/libressl/portable/pull/935#issuecomment-1798345787
Brent Cook 4830b1ee 2023-11-05T14:33:56 Land #932, use existing crypto/ssl libs for tls tests
Viktor Szakats 89fcb1a3 2023-11-05T08:56:09 also fix ocspcheck and nc, dedupe build logic
Viktor Szakats 2c5abde7 2023-11-04T02:37:34 slim `tls-static` library (used in tests) Instead of including a full copy of libcrypto and libssl in libtls-static, link existing libcrytpo-static and libssl-static to the test targets. This wasn't causing any issue, just unnecessarily duplicating a lot of objects.
Brent Cook 9bca15ba 2023-10-29T18:00:38 reenable assembly for MSVC
Brent Cook 1fd73818 2023-10-15T19:05:29 adjust how sizeof time_t is set, the current way causes issues with MSVC 2022's preprocessor
Brent Cook ce79c964 2023-10-29T12:34:01 Land #913, CMake build fixes
Brent Cook 321fa56d 2023-10-09T01:30:00 disable MSVC x64 asm
Brent Cook fca20b23 2023-10-02T03:31:24 remove unneeded switch for MSVC, cleanup comment alignment
Marc Aldorasi 46635430 2023-09-12T15:07:51 Consistently use CMAKE_CURRENT_BINARY_DIR
Jiajie Chen 70688874 2023-09-04T09:05:45 Fix processor detection in CMakeLists.txt
Brent Cook f4059e47 2023-08-28T00:40:11 enable asserts regardless of build type
Pierre Wendling 86a6826f 2023-08-15T11:08:06 Move `LibreSSL/` to `LIBRESSL_INSTALL_CMAKEDIR`. This allows users to install the CMake configs without forcing a `LibreSSL` directory after `LIBRESSL_INSTALL_CMAKEDIR`.
Pierre Wendling a89cd659 2023-08-06T15:07:31 CMake: Export and install library targets. The configs can be consumed by setting LibreSSL_DIR to the build directory, or after installation using CMAKE_PREFIX_PATH/LibreSSL_DIR. For compatibility, the EXPORT_NAME of targets and the LIBRESSL_* variables are set to match the names used in FindLibreSSL.
Brent Cook ca8ea652 2023-08-13T23:23:23 Land #894, fix to enable ASM support in MinGW builds
Brent Cook 7e59829f 2023-08-13T23:02:24 version is breaking things
Brent Cook 125c54cd 2023-07-27T06:10:20 set default build type to 'Release'
Viktor Szakats 5c63ba97 2023-08-06T18:13:51 cmake: fix to use MINGW variable to detect MinGW
Brent Cook 00fc21e8 2023-07-07T18:28:06 Remove hard-coded optimization level in CMake builds Fixes #683. These are not compiler-agnostic, and can interfere with user overrides as well. The defaults in Cmake are reasonable.
Brent Cook 51368394 2023-07-07T04:32:20 Land #886, add compat getopt implementation
Brent Cook 7463f87c 2023-07-07T11:46:21 add compat getopt implementation, remove patches This adds a getopt implementation for compatibility where it is not available, removing a couple of regress patches. Note, this is a slightly modified copy from OpenBSD libc that doesn't expose getopt_long, which has dependency conflicts with Windows system headers and isn't needed anyway.
Brent Cook afcd4be8 2023-07-06T20:32:34 change socket / file descriptor checks on windows based on discussion in https://github.com/libressl/portable/issues/266 and https://bugs.python.org/issue23524 adjust the compat layer for Windows to use _get_osfhandle in combination with _set_thread_local_invalid_parameter_handler if applicable to more reliably determine if a handle is a socket, file, or closed socket. This prevents assertions when calling tls_close on an already-closed socket.
Brent Cook 2203c13d 2023-07-04T12:36:57 make cross compilation possible on macOS with CMake Sync CMAKE_SYSTEM_PROCESSOR to CMAKE_OSX_ARCHITECTURES. This doesn't support universal binaries, but does allow cross-compiling for a single architecture by setting -DCMAKE_OSX_ARCHITECTURES=(arm64|x86_64)
Brent Cook 419fbd6f 2023-05-26T21:51:56 fix asm on x86_64 macos
Theo Buehler 94763de5 2023-04-25T11:47:02 Disable assembly on macos for now
Brent Cook ab214b56 2023-02-27T07:26:07 handle i?86 for 32-bit CMake builds
Brent Cook b0310cb3 2023-02-27T05:48:23 set CMAKE_SYSTEM_PROCESSOR when cross compiling handle x86 as option for 32-bit x86 on Windows
Brent Cook a0a6e7bd 2023-02-25T10:34:43 reenable aarch64 asm for macos
Brent Cook a498c6a7 2023-02-23T08:31:31 only disable asm on aarch64 for now, enable for other archs
Brent Cook 4bcb537a 2023-02-21T01:13:29 generally disable asm for now
Brent Cook 5a695723 2023-02-21T01:13:08 disable BN ASM for aarch64 for now (fails tests)
Brent Cook 8fc30eca 2023-02-21T00:25:04 generate and include arch-specific headers for CMake builds
Jiajie Chen ef2d6c70 2022-07-12T22:29:39 Detect machine/endian.h for macOS
kinichiro 9a18f424 2022-01-17T19:04:23 Add libmd as platform specific libraries for Solaris
Brent Cook 549ead1f 2021-11-30T10:58:12 adjust cmake check to include dependencies for netinet/ip.h
kinichiro 870a1ebb 2021-11-27T20:57:14 Build static library for regression tests when shared build with CMake
Brent Cook 2ac3d32e 2021-11-09T23:04:29 Update CMake for new header checks
Brent Cook b3b08741 2021-11-09T07:08:46 Land #694, Add the option for Apple-style xcframework libraries
Tobias Heider 2d853ecf 2021-11-06T23:31:26 Don't install pkgconfig if ENABLE_LIBRESSL_INSTALL is disabled.
Cameron Lowell Palmer 6318b4ec 2021-10-15T09:29:03 Add the option to support an Apple-style xcframework for tls, ssl, and crypto
Tobias Heider 7072a55b 2021-07-19T15:10:49 Add -DHAVE_GNU_STACK on ELF platforms to enable non-executable stack annotations for the GNU toolchain.
kinichiro b25111c2 2021-05-29T20:23:04 Fix UWP build - Do not set _WIN32_WINNT to enable VirtualAllocFromApp - Disable tlstest since SetHandleInformation is not supported on UWP
Paweł Wegner 21ab7331 2021-05-16T13:52:06 cmake: tweak for clang-cl This change allows libressl to be built with clang-cl.
kinichiro 4c56df46 2021-05-02T15:50:37 Statically link libcrypto/ssl into libtls with cmake
Brent Cook 921c0675 2021-04-05T02:32:35 Add '--enable-libtls-only' build option
Brent Cook df3d4bb5 2020-11-11T05:39:56 Add -lbcrypt to Windows builds for CNG in getentropy
Samuel Marks 12a400c9 2020-05-23T17:16:04 [CMakeLists.txt] Move `project` below `cmake_minimum_required`; fix indentation in its `if`/`else` block; [tap-driver.sh] Copyright line update (was automatic with `./autogen.sh`)
kinichiro 740488d8 2020-05-09T18:46:13 Fix cmake build to enable masm with VS2019 To specify architecture Visual Studio 16 2019 requires -A option, and it is stored in variable CMAKE_GENERATOR_PLATFORM. Until Visual Studio 15 2017, architecture was indicated as part of generator string (e.g. "Visual Studio 15 2017 Win64")
Brent Cook 012014df 2020-05-01T08:31:11 more MSVC build/test tweaks