Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1f12fc68
Commit
1f12fc68
authored
Mar 26, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print found version on OpenSSL version mismatch
parent
e97b041b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
18 deletions
+26
-18
CMakeLists.txt
CMakeLists.txt
+12
-18
cmake/openssl-check.cpp
cmake/openssl-check.cpp
+14
-0
No files found.
CMakeLists.txt
View file @
1f12fc68
cmake_minimum_required
(
VERSION 2.8.12
)
project
(
caf C CXX
)
include
(
CheckCSourceCompiles
)
include
(
CheckCSourceRuns
)
project
(
caf CXX
)
# Set default install paths.
# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
...
...
@@ -601,21 +598,18 @@ elseif(NOT CAF_NO_OPENSSL)
else
()
if
(
NOT CMAKE_CROSSCOMPILING
)
# Check if openssl headers and library versions match
set
(
CMAKE_REQUIRED_LIBRARIES
${
OPENSSL_LIBRARIES
}
)
set
(
CMAKE_REQUIRED_INCLUDES
${
OPENSSL_INCLUDE_DIR
}
)
check_c_source_runs
(
"
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
int main() {
if (SSLeay() == OPENSSL_VERSION_NUMBER) {
return 0;
}
return -1;
}
"
OPENSSL_CORRECT_VERSION_NUMBER
)
if
(
NOT OPENSSL_CORRECT_VERSION_NUMBER
)
try_run
(
sslRunResult sslCompileResult
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/openssl-check.cpp"
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES=
${
OPENSSL_INCLUDE_DIR
}
"
LINK_LIBRARIES
${
OPENSSL_LIBRARIES
}
OUTPUT_VARIABLE sslOutput
)
if
(
NOT sslCompileResult
)
message
(
FATAL_ERROR
"failed to compile/link against OpenSSL"
)
endif
()
if
(
NOT sslRunResult EQUAL 0
)
message
(
FATAL_ERROR
"OpenSSL library version does not match headers
"
)
"OpenSSL version does not match headers:
${
sslOutput
}
"
)
endif
()
endif
()
include_directories
(
BEFORE
${
OPENSSL_INCLUDE_DIR
}
)
...
...
cmake/openssl-check.cpp
0 → 100644
View file @
1f12fc68
#include <openssl/crypto.h>
#include <openssl/opensslv.h>
#include <cstdio>
#include <cstdlib>
int
main
()
{
long
have
=
SSLeay
();
long
want
=
OPENSSL_VERSION_NUMBER
;
printf
(
"have OpenSSL %lx, want %lx
\n
"
,
have
,
want
);
if
(
have
==
want
)
return
EXIT_SUCCESS
;
return
EXIT_FAILURE
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment