0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00
Commit Graph

44 Commits

Author SHA1 Message Date
Razvan Cojocaru
bd5685c921 Add -Wnon-virtual-dtor to the UNIX C++ compiler flags
Signed-off-by: Razvan Cojocaru <razvan.cojocaru@openvpn.com>
2024-08-08 14:43:12 +00:00
Frank Lichtenheld
20260b27f6 CodeCoverage.cmake: Import coverage helper code
From https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake

Jira: OVPN3-1237
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-07-25 13:43:22 +00:00
RenovateBot
13d6b06e1c chore(deps): update dependency google/googletest to v1.15.0 2024-07-17 10:00:24 +00:00
RenovateBot
e150bb3985 chore(deps): update dependency google/googletest to v1.14.0 2024-03-28 11:27:25 +00:00
Frank Lichtenheld
4a51628afe
Tweaking renovate config
- Group GHA updates and set them to monthly schedule to
  drastically reduce the numbers of PRs
- Notify about GoogleTest updates

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-03-13 16:43:52 +01:00
Arne Schwabe
c1bcf78d2e Add support for mbed TLS 3.0
This currently still depends on the mbed TLS compat API functionality.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-02-23 15:32:58 +01:00
Frank Lichtenheld
9b8797fe5e
CMake: Refine CXX_STANDARD setting
- Set CXX_STANDARD_REQUIRED ON so that we error out early
  if CMake thinks that the compiler does not support the
  used standard.
- Set CXX_EXTENSIONS OFF so that we get less compiler
  specific behavior.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-11-08 21:10:21 +01:00
Frank Lichtenheld
268bf42b9e
CMake: accept all NEW policies in released CMake versions
Using the <max> argument to cmake_minimum_required will
set all policies up to <max> to NEW. We might need to
fix some issues arising from that, but this means that
modern CMake can already behave like it wants even with
leaving <min> so that we can support old distros (currently
Debian 10).

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-11-08 21:10:20 +01:00
Frank Lichtenheld
72275db1d5
client: Switch to UseSWIG instead of manual custom command
On modern CMake this gets us swig dependency management,
which should reduce problems for incremental builds.
Also it is just cleaner.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-11-08 21:10:19 +01:00
Frank Lichtenheld
6e7a98b5f4 CMake: Add USE_WCONVERSION option
Makes it easier to test with -Wconversion, e.g. in Jenkins.

For now disable -Wsign-conversion. That is the default in g++,
but not clang++. Once we have fixed all -Wsign-conversion
warnings, we can enable it for both.

For now disable -Wenum-enum-conversion. Only present in clang++.
Not clear whether cleaning those up will be worth the effort.

Disable -ferror-limit in clang++. This ensures that it always
displays all errors.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-10-24 15:29:31 +02:00
Frank Lichtenheld
cf4fa0b3d6
MSVC: raise warning level for MSVC from /W2 to /W3
Now that all the warnings for /W3 are fixed, we can
use the default level again.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-09-28 11:33:47 +02:00
Frank Lichtenheld
aec6902cd2 CMake: Set warning options for MSVC so we can enable /WX
Reduce default set from /W3 to /W2 and disable two
additional warnings that we do not care about.

With these settings successful builds with /WX are possible.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-08-03 18:11:02 +02:00
Frank Lichtenheld
d7e8375fc5
CMake: disable -Wmaybe-uninitialized for GCC builds
This is very noisy with lots of false positives, especially
in newer version of GCC. So for now disable this.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-08-02 18:15:25 +02:00
Frank Lichtenheld
bb61350ae5
CMake: replace FindPythonIntp with FindPython3
The earlier were deprecated since CMake 3.12.
Since CMake 3.27 this causes deprecation warnings.
Should be safe nowadays to require CMake 3.12.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-08-02 18:08:42 +02:00
Frank Lichtenheld
775ff02527
dlgoogletest: update GoogleTest to latest upstream
This fixes deprecation warnings with latest CMake.
("Compatibility with CMake < 3.5 will be removed
from a future version of CMake.")

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-08-02 17:25:16 +02:00
Frank Lichtenheld
474de6c93f CMake: make doxygen generation work better
- Use CURRENT source and binary dir to make this work even
  if used as a sub-directory in another project.
- Make USE_MDFILE_AS_MAINPAGE actually work. It is only
  used when part of the INPUT and does not automatically
  add it to INPUT.
- Make sure CMake uses the latest version of README.rst
  by using configure_file instead of file(COPY).
- Improve EXCLUDE_PATTERNS.
- Add NUM_PROC_THREADS.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-04-24 14:32:31 +02:00
Frank Lichtenheld
bc7f4be01b CMake: Reorder includes to prefer asio
By adding the asio includes first we have a better
chance to force using "our" asio. This can be important
since some parts of the code require a patched version.

The actual "core" parts of the code work fine with
upstream asio however, so I also do not want to
force the patched asio by requiring a special header
name or directory structure.

So this is a compromise solution which hopefully works
for most use-cases.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-03-20 13:37:05 +01:00
Frank Lichtenheld
d7b3419f8e CMake: clean up dependency handling
Always use find_package for all libraries.
Add missing Find*.cmake modules.
Always define an IMPORTED library in Find*

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 13:45:16 +01:00
Frank Lichtenheld
3f8639ea81 dlgoogletest.cmake: remove work-around for CMake < 3.10
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 13:45:16 +01:00
Frank Lichtenheld
e720bf3aba CMake: Generalize add_json_library
Make sure we find vcpkg and system packages on all
platforms.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 12:30:30 +01:00
Frank Lichtenheld
2fb5d08ea0 CMake: Fix issues in FindmbedTLS
Use add_library to define a target so that we do not
need to apply all the setting manually.
Use find_package_message() to avoid printing the
message more than once.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 12:30:30 +01:00
Frank Lichtenheld
18f3ae7c25 Switch builds to c++17 standard
We want to use features only present with c++17.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-09 13:15:02 +01:00
Arne Schwabe
8b3542cd72 Remove LZ4_DISABLE_DEPRECATE_WARNINGS flag.
We do not use any deprecated LZ4 functions. So we can remove this flag
from our builds.

Reported-By: Trail of Bits (TOB-OVPN3-1)
2023-02-01 16:43:53 +01:00
David Sommerseth
0fae5639ac
build: Extend with a doxygen build target
If the ENABLE_DOXYGEN setting is enabled in CMake, it will look for the
local Doxygen installation and configure it.  The HTML output will be
located under doxygen/core.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-09-21 17:21:16 +02:00
Arne Schwabe
d8ba200274
split out add_ssl_library function from add_core_dependencies
This allows the function to select and add the SSL library without
adding in all other core dependencies.

Also remove CORE_INCLUDES and CORE_DEFINES and just use normal
target_include_directories/target_compile_defintions instead.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-06-08 22:35:07 +02:00
Frank Lichtenheld
592b6c4604 cmake: create findswigdeps to reduce code duplication
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-16 13:02:19 +01:00
Frank Lichtenheld
5ce5514fbe findcoredeps: use pkg config for libjsoncpp on Mac OS
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-01-24 13:50:03 +01:00
Frank Lichtenheld
d5f65e51e1 findcoredeps: remove noop line
That variable is not defined here, since we didn't call
any find_package for it.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2021-12-22 10:30:24 +01:00
Frank Lichtenheld
e3a1f4a17a
dlgoogletest.cmake: Make sure we always set OVPN_GTEST_VERSION
Otherwise ExternalProject_add defaults to "master"
which is not only was a changing target but now it
doesn't even exist anymore since they renamed it to
"main".

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2021-11-18 18:28:54 +01:00
Mark Deric
989d2f590a
WIP Fix the rhel7 unit test target failure
This might not be the final fix.  Note the extensive code comment
inside the cmake file if().  The comment suggest a potentially better
fix, but it's unlikely.

Signed-off-by: Mark Deric <jmark@openvpn.net>
2021-09-22 14:04:48 +02:00
Horki
82beb7501d
gtest: update to v1.11.0
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2021-08-18 19:38:36 +02:00
Lev Stipakov
d31620d0c6
agent mac: move from common
Windows agent has been moved from common to core,
so for consistency move mac agent too.

Since agent and agent-enabled client depend on jsoncpp,
also move jsoncpp build scripts.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-06-10 23:06:24 +02:00
Lev Stipakov
8cae2a770b
asio: support for version 1.18
ASIO 1.18 enabled UNIX domain sockets on Windows,
which breaks our code, since we use Linux-specific
API to work with sockets.

Fix by disabling UNIX domain (local in ASIO terminology)
sockets on Windows.

Bump ASIO version to 1.18.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-06-10 22:43:26 +02:00
Lev Stipakov
516b32c2b8
findcoredeps.cmake: fix incorrect pkg_check_modules() behavior for mingw
pkg_check_modules() sets PKG_CONFIG_PATH by
joining values of CMAKE_PREFIX_PATH list and then replacing
separator ";" with ":". However, replacing was broken for mingw and
was fixed very recently. As a workaroud, create CMAKE_PREFIX_PATH
with single value to avoid broken join.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:53 +01:00
Arne Schwabe
73c9a592ae Pin googletest version due to google/googletest#2711
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
Lev Stipakov
81e1353ea9
mingw: add build dependencies to cmake
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:45 +02:00
Lev Stipakov
1a3b5235cc
mingw: use generic way to install gtest
find_package() works with vcpkg, which
is used only by msvc build system.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:44 +02:00
Lev Stipakov
1c9834c50d win: replace msvc project files with cmake
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-01-29 23:24:54 +01:00
Arne Schwabe
cb229c7bba
Add -Wall option by default to openvpn compile
Fix DCO compile from a fresh checkout

Allow do use -DUSE_WERROR=true to error out on warnings during the build
2020-01-15 23:08:29 +01:00
Lev Stipakov
0e13f83152
findcoredeps.cmake: add missing libs to ovpncli
Those are required by Wintun support core.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-12-11 16:15:54 +02:00
Arne Schwabe
9baaa88f08 set PLAT macro as OPENVPN_PLAT so other cmake files can also use it
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Lev Stipakov
5e2bef23e3
cmake: update findcoredeps to work with vcpkg
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-07 10:44:21 +02:00
Arne Schwabe
236d39258b Allow overriding DEP_DIR by environment variable 2019-05-13 14:49:36 +02:00
Arne Schwabe
d56e049ea4 Refactor dependencies to be in a cmake script
This allows the dependencies to be used by multiple parts of the project,
e.g. non public unit tests, ovpncli etc.

Building ovpncli demostrates this
2019-05-13 14:49:36 +02:00