Commit 34f083f1 authored by Davide Pesavento's avatar Davide Pesavento Committed by Christian Kandeler

Allow building against a system-wide installation of botan.

Task-number: QTCREATORBUG-8588

Change-Id: I429b7dc101b780a66b3e92c40eef3efef2328bf2
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 9cb7e7e4
......@@ -8,6 +8,22 @@
#ifndef BOTAN_AMALGAMATION_H__
#define BOTAN_AMALGAMATION_H__
#ifdef USE_SYSTEM_BOTAN
#include <botan/auto_rng.h>
#include <botan/cbc.h>
#include <botan/der_enc.h>
#include <botan/dh.h>
#include <botan/dl_group.h>
#include <botan/dsa.h>
#include <botan/hmac.h>
#include <botan/init.h>
#include <botan/lookup.h>
#include <botan/pem.h>
#include <botan/pubkey.h>
#include <botan/rsa.h>
#include <botan/ui.h>
#else
#include <QtGlobal>
#include <iosfwd>
......@@ -16184,5 +16200,5 @@ class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode
}
#endif
#endif // USE_SYSTEM_BOTAN
#endif // BOTAN_AMALGAMATION_H__
INCLUDEPATH *= $$PWD/..
HEADERS += $$PWD/botan.h
equals(USE_SYSTEM_BOTAN, 1) {
DEFINES += USE_SYSTEM_BOTAN
CONFIG += link_pkgconfig
PKGCONFIG += botan-1.10
} else {
SOURCES += $$PWD/botan.cpp
CONFIG += exceptions
......@@ -46,3 +53,4 @@ unix:*-g++* {
linux*|freebsd* {
LIBS += -lrt
}
}
......@@ -44,9 +44,17 @@ QtcLibrary {
"sshsendfacility.cpp", "sshsendfacility_p.h",
].concat(botanFiles)
property var botanIncludes: ["../3rdparty"]
property var useSystemBotan: qbs.getenv("USE_SYSTEM_BOTAN") === "1"
property var botanIncludes: {
var result = ["../3rdparty"];
if (useSystemBotan)
result.push("/usr/include/botan-1.10")
return result
}
property var botanLibs: {
var result = [];
if (useSystemBotan)
result.push("botan-1.10")
if (qbs.targetOS === "windows")
result.push("advapi32", "user32")
else {
......@@ -57,7 +65,11 @@ QtcLibrary {
return result
}
property var botanDefines: {
var result = ['BOTAN_DLL=']
var result = [];
if (useSystemBotan)
result.push("USE_SYSTEM_BOTAN")
else {
result.push("BOTAN_DLL=")
if (qbs.toolchain === "msvc")
result.push("BOTAN_BUILD_COMPILER_IS_MSVC", "BOTAN_TARGET_OS_HAS_GMTIME_S")
if (qbs.toolchain === "gcc" || qbs.toolchain === "mingw")
......@@ -81,9 +93,15 @@ QtcLibrary {
"BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK", "BOTAN_HAS_DYNAMICALLY_LOADED_ENGINE",
"BOTAN_HAS_DYNAMIC_LOADER", "BOTAN_HAS_ENTROPY_SRC_CAPI",
"BOTAN_HAS_ENTROPY_SRC_WIN32", "BOTAN_HAS_MUTEX_WIN32")
return result
}
property var botanFiles: [ "../3rdparty/botan/botan.h", "../3rdparty/botan/botan.cpp" ]
return result
}
property var botanFiles: {
var result = ["../3rdparty/botan/botan.h"];
if (!useSystemBotan)
result.push("../3rdparty/botan/botan.cpp")
return result
}
// For Botan.
Properties {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment