127 Commits

Author SHA1 Message Date
Brent Cook
ce79c96489 Land #913, CMake build fixes 2023-10-29 12:34:01 -05:00
Brent Cook
321fa56d9a disable MSVC x64 asm 2023-10-29 11:20:18 -05:00
Brent Cook
fca20b23d6 remove unneeded switch for MSVC, cleanup comment alignment 2023-10-29 11:17:00 -05:00
Marc Aldorasi
4663543082 Consistently use CMAKE_CURRENT_BINARY_DIR 2023-09-12 15:07:51 -04:00
Jiajie Chen
70688874f8 Fix processor detection in CMakeLists.txt 2023-09-04 09:34:44 +08:00
Brent Cook
f4059e4775 enable asserts regardless of build type 2023-08-29 00:28:53 -05:00
Pierre Wendling
86a6826fef
Move LibreSSL/ to LIBRESSL_INSTALL_CMAKEDIR.
This allows users to install the CMake configs without forcing a
`LibreSSL` directory after `LIBRESSL_INSTALL_CMAKEDIR`.
2023-08-19 12:16:16 -04:00
Pierre Wendling
a89cd65980
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.
2023-08-19 12:16:15 -04:00
Brent Cook
ca8ea65259 Land #894, fix to enable ASM support in MinGW builds 2023-08-13 23:23:23 -05:00
Brent Cook
7e59829f18 version is breaking things 2023-08-13 23:03:38 -05:00
Brent Cook
125c54cdd7 set default build type to 'Release' 2023-08-13 21:01:49 -05:00
Viktor Szakats
5c63ba9761
cmake: fix to use MINGW variable to detect MinGW 2023-08-10 23:01:37 +00:00
Brent Cook
00fc21e8a7 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.
2023-07-07 18:38:57 +03:00
Brent Cook
51368394eb Land #886, add compat getopt implementation 2023-07-07 04:32:20 -05:00
Brent Cook
7463f87cf1 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.
2023-07-07 12:11:20 +03:00
Brent Cook
afcd4be8a7 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.
2023-07-06 20:32:34 +03:00
Brent Cook
2203c13d25 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)
2023-07-04 12:36:57 +03:00
Brent Cook
419fbd6fba fix asm on x86_64 macos 2023-05-26 21:51:56 -05:00
Theo Buehler
94763de52b Disable assembly on macos for now 2023-04-25 12:43:20 +02:00
Brent Cook
ab214b5696 handle i?86 for 32-bit CMake builds 2023-02-27 07:26:07 -06:00
Brent Cook
b0310cb34e set CMAKE_SYSTEM_PROCESSOR when cross compiling
handle x86 as option for 32-bit x86 on Windows
2023-02-27 05:48:23 -06:00
Brent Cook
a0a6e7bd07 reenable aarch64 asm for macos 2023-02-25 10:35:21 -06:00
Brent Cook
a498c6a7c9 only disable asm on aarch64 for now, enable for other archs 2023-02-23 08:31:31 -06:00
Brent Cook
4bcb537aa8 generally disable asm for now 2023-02-21 01:39:35 -06:00
Brent Cook
5a695723ab disable BN ASM for aarch64 for now (fails tests) 2023-02-21 01:13:08 -06:00
Brent Cook
8fc30eca61 generate and include arch-specific headers for CMake builds 2023-02-21 00:25:04 -06:00
Jiajie Chen
ef2d6c70da Detect machine/endian.h for macOS 2022-07-12 22:29:39 +08:00
kinichiro
9a18f4247e Add libmd as platform specific libraries for Solaris 2022-01-17 19:04:23 +09:00
Brent Cook
549ead1f94 adjust cmake check to include dependencies for netinet/ip.h 2021-11-30 10:58:12 -06:00
kinichiro
870a1ebbc2 Build static library for regression tests when shared build with CMake 2021-11-27 20:57:14 +09:00
Brent Cook
2ac3d32ec5 Update CMake for new header checks 2021-11-09 23:04:29 -06:00
Brent Cook
b3b087416c Land #694, Add the option for Apple-style xcframework libraries 2021-11-09 07:08:46 -06:00
Tobias Heider
2d853ecfc3 Don't install pkgconfig if ENABLE_LIBRESSL_INSTALL is disabled. 2021-11-06 23:31:26 +01:00
Cameron Lowell Palmer
6318b4ec48 Add the option to support an Apple-style xcframework for tls, ssl, and crypto 2021-10-15 17:58:58 +02:00
Tobias Heider
7072a55b80 Add -DHAVE_GNU_STACK on ELF platforms to enable non-executable
stack annotations for the GNU toolchain.
2021-07-20 18:19:47 +02:00
kinichiro
b25111c22d Fix UWP build
- Do not set _WIN32_WINNT to enable VirtualAllocFromApp
- Disable tlstest since SetHandleInformation is not supported on UWP
2021-05-29 20:55:50 +09:00
Paweł Wegner
21ab73316f cmake: tweak for clang-cl
This change allows libressl to be built with clang-cl.
2021-05-18 16:39:39 +02:00
kinichiro
4c56df46de Statically link libcrypto/ssl into libtls with cmake 2021-05-07 20:31:22 +09:00
Brent Cook
921c0675a2 Add '--enable-libtls-only' build option 2021-04-07 07:51:45 -05:00
Brent Cook
df3d4bb57a Add -lbcrypt to Windows builds for CNG in getentropy 2020-11-11 05:39:56 -06:00
Samuel Marks
12a400c90d
[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) 2020-05-23 17:16:04 +10:00
kinichiro
740488d89e 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")
2020-05-09 20:24:27 +09:00
Brent Cook
012014df35 more MSVC build/test tweaks 2020-05-01 08:31:11 -05:00
Brent Cook
13159a59e1 make cmake version bump conditional on MSVC 2020-05-01 04:34:48 -05:00
Brent Cook
1c3377bac0 bump cmake and appveyor build environment 2020-05-01 04:09:57 -05:00
OJ
4d07b727d2
Force use of 3.15.7 2020-04-20 20:28:48 +10:00
OJ
79fb34a90b
Add support for use of static MSVC runtimes
In certain contexts LibreSSL needs to be built with `/MT` instead of `/MD` for inclusion in other projects. These changes allow for the command-line option `USE_STATIC_MSVC_RUNTIMES` to be set to `ON` if the use wishes to generate projects that will build with static runtimes.

This feature requires CMAKE version 3.15+, hence the minimum required version has changed as well.
2020-04-15 13:12:31 +10:00
Matthew Albrecht
a4338ca124
Check for existing uninstall target before creating. 2019-09-20 15:15:11 -05:00
kinichiro
30e91bc6d2 Enable speed on win32
- Use thread and sleep instead of signal and alarm, on win32
- Disable -multi option on win32 since fork is hard to implement
2019-07-14 19:45:34 +09:00
kinichiro
389145ed42 Fix illegal pkg-config file generated 2019-07-09 20:56:17 +09:00