22 Commits

Author SHA1 Message Date
Fletcher Dunn fd9100873b Remove custom MSVC CRT management
Use CMake's built-in CMAKE_MSVC_RUNTIME_LIBRARY instead.
This requires CMake 3.15), so bump cmake_minimum_required accordingly.
2026-05-03 21:00:32 -07:00
Lily Wang 725e273c74 Add find_dependency(Protobuf) 2024-09-30 09:34:18 -07:00
Tomas Maly 62b395172f use link_libraries in try_compile instead of pragma lib in cpp 2024-09-09 13:18:35 -07:00
Tomas Maly 5020374ad7 improved test if bcrypt is available 2024-09-09 13:18:35 -07:00
Fletcher Dunn e541572360 Update openssl to require version >= 1.1.1.
Remove options to specify the library to use for 25519.
Remove some unnecessary platform differences in opensslwrapper.cpp.
2022-04-07 18:51:50 -07:00
Eddie James 869268a56d Fix install for separate shared/static libraries 2021-11-23 09:38:09 -08:00
Eddie James f513d2f33f Enable steamwebrtc export 2021-11-23 09:38:09 -08:00
Fletcher Dunn 29925cedde Tweaking cmake options
Added MSVC_CRT_STATIC option.  Defaults to off.  Should help with linking
against protobuf or other situations.

Added BUILD_STATIC_LIB and BUILD_SHARED_LIB options.  (Fixes issue #191)

I think I probably also need to add an option to build the cert tool
and maybe package it up, too (issue #186) but that isn't included
in this change.
2021-11-15 09:30:18 -08:00
Andrew Simpson ad9e041c1a Fixes to install config setup. 2021-01-04 10:10:12 -08:00
Fletcher Dunn 9a59089e8d Move where we dump CMAKE_BUILD_TYPE.
We need to wait until after we include DefaultBuildType!
2020-10-09 11:59:16 -07:00
Andrew Simpson 34ead6c9e2 Fixes for WebRTC / vcpkg build
* Fixed installation with WebRTC is enabled
* Added vcpkg feature option for webrtc
* Try to detect abseil before using our own submodule copy (means we can use the one from vcpkg)
* Fixed standalone example build
* Shaved down abseil dependencies and use properly namespaced names
2020-10-06 16:28:48 -07:00
Andrew Simpson 1825ee68ae Tweak to the install destinations
Made the creation of imported GameNetworkingSockets::shared and GameNetworkingSockets::static aliases conditional on CMake version being >= 3.11
2020-08-29 09:28:14 -07:00
Andrew Simpson 2d1ae278d5 Added ability to install GameNetworkingSockets from CMake
Also tweaked the example chat configuration so that it can be built standalone using the installed library.
2020-08-28 17:21:40 -07:00
Andrew Simpson b2ae48a260 implement libsodium support
- Added support for using libsodium for encryption rather than OpenSSL
 - Removed AES-GCM tests with keys shorter than 256; libsodium only supports 256
 - Added a build with libsodium to the CI matrix

Signed-off-by: Andrew Simpson <andy@aiusepsi.co.uk>

steven@ edited and rebased:

 - integrated with new USE_CRYPTO/USE_CRYPTO25519 options in CMake/meson
 - separated using libsodium for ed25519/curve25519 and AES/SHA256.
 - ensured libsodium simple crypto tests run on all builders instead of
   a single isolated builder.
 - prevented building with -DUSE_CRYPTO=libsodium for non-x86 hardware,
   as libsodium's AES implementation depends on AES-NI. it is still
   possible to configure with -DUSE_CRYPTO25519=libsodium on arbitrary
   hardware targets.

Fixes #88.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-01-21 05:02:07 -08:00
Steven Noonan cfe781c4a9 ubsan: turn off -fsanitize=alignment
There's really no good fix for these other than doing something like
memcpy, and they are effectively just noisy for no good reason right
now.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-01-08 16:29:33 -08:00
Steven Noonan b5db1d1a0a cmake: set RelWithDebInfo as default build type
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2019-03-01 13:57:22 -08:00
Steven Noonan 13fbdbe1e3 remove libsodium completely
It was a good experiment to show that our reference code for
ed25519/curve25519 was slow. Now we just need to move to OpenSSL for
25519.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2019-01-21 14:03:57 -08:00
Steven Noonan 1113cf75c7 cmake: add some helpers to find sanitizers
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2019-01-17 00:18:50 -08:00
Steven Noonan 8d84c50686 Findsodium.cmake: update from libsodium git repo
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2019-01-15 19:51:17 -08:00
Steven Noonan e7a3f1541c add option to use libsodium for ed25519/curve25519
This offers a pretty nice performance boost: 3.7x throughput and 0.26x the
latency for ed25519, and 0.38x the latency for curve25519 key exchange.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2019-01-10 16:38:44 -08:00
Steven Noonan 6dd34d742b CMake: fix some build issues on Windows with VS2017
Ensure that we disable C++ exceptions and RTTI for both static and
dynamic libraries. Also only enable LTCG for the DLL (since it makes the
unlinked static library rather large).

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2018-04-10 13:19:27 -07:00
Steven Noonan 08b37453a4 CMake: adding work-in-progress CMakeLists files
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2018-04-04 06:25:24 -07:00