fix compilation
This commit is contained in:
parent
aafea80a3c
commit
57283d68d1
6 changed files with 15 additions and 8 deletions
|
@ -41,7 +41,7 @@ find_package(event)
|
||||||
set(Swiften_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
|
set(Swiften_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
|
||||||
find_package(Swiften REQUIRED)
|
find_package(Swiften REQUIRED)
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(openssl_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
|
set(openssl_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
|
||||||
find_package(openssl REQUIRED)
|
find_package(openssl REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
@ -238,7 +238,7 @@ include_directories(${EVENT_INCLUDE_DIRS})
|
||||||
include_directories(${SWIFTEN_INCLUDE_DIR})
|
include_directories(${SWIFTEN_INCLUDE_DIR})
|
||||||
include_directories(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften)
|
FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften)
|
||||||
FIND_PATH(SWIFTEN_INCLUDE_DIR NAMES "Swiften.h" PATH_SUFFIXES libSwiften Swiften )
|
FIND_PATH(SWIFTEN_INCLUDE_DIR NAMES "Swiften/Swiften.h" PATH_SUFFIXES libSwiften Swiften )
|
||||||
|
|
||||||
if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
|
if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
|
||||||
find_program(SWIFTEN_CONFIG_EXECUTABLE NAMES swiften-config DOC "swiften-config executable")
|
find_program(SWIFTEN_CONFIG_EXECUTABLE NAMES swiften-config DOC "swiften-config executable")
|
||||||
|
@ -27,7 +27,7 @@ if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
|
||||||
message( FATAL_ERROR "Could NOT find swiften-config" )
|
message( FATAL_ERROR "Could NOT find swiften-config" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( SWIFTEN_INCLUDE_DIR ${SWIFTEN_INCLUDE_DIR}/.. )
|
set( SWIFTEN_INCLUDE_DIR ${SWIFTEN_INCLUDE_DIR} )
|
||||||
message( STATUS "Found libSwiften: ${SWIFTEN_LIBRARY}, ${SWIFTEN_INCLUDE_DIR}")
|
message( STATUS "Found libSwiften: ${SWIFTEN_LIBRARY}, ${SWIFTEN_INCLUDE_DIR}")
|
||||||
set( SWIFTEN_FOUND 1 )
|
set( SWIFTEN_FOUND 1 )
|
||||||
else( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
|
else( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
|
||||||
|
|
|
@ -18,8 +18,10 @@ ADD_DEPENDENCIES(transport-plugin pb)
|
||||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.pb.cc PROPERTIES GENERATED 1)
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.pb.cc PROPERTIES GENERATED 1)
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
if (NOT WIN32)
|
||||||
ADD_DEFINITIONS(-fPIC)
|
ADD_DEFINITIONS(-fPIC)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES})
|
TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES})
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
|
||||||
if (PROTOBUF_FOUND)
|
if (PROTOBUF_FOUND)
|
||||||
|
if (WIN32)
|
||||||
|
set (PROTOBUF_PROTOC_EXECUTABLE protoc)
|
||||||
|
endif()
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protocol_pb2.py
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protocol_pb2.py
|
||||||
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_BINARY_DIR}/../../include/transport/ ${CMAKE_CURRENT_BINARY_DIR}/../../include/transport/protocol.proto
|
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/ ${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.proto
|
||||||
COMMENT "Running Python protocol buffer compiler on protocol.proto"
|
COMMENT "Running Python protocol buffer compiler on protocol.proto"
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/../../include/transport/protocol.proto
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.proto
|
||||||
)
|
)
|
||||||
ADD_CUSTOM_TARGET(pb-python ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/protocol_pb2.py)
|
ADD_CUSTOM_TARGET(pb-python ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/protocol_pb2.py)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -24,8 +24,10 @@
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#define getcwd _getcwd
|
#define getcwd _getcwd
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#define PATH_MAX MAX_PATH
|
#define PATH_MAX MAX_PATH
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace boost::program_options;
|
using namespace boost::program_options;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "discoinforesponder.h"
|
#include "discoinforesponder.h"
|
||||||
#include "discoitemsresponder.h"
|
#include "discoitemsresponder.h"
|
||||||
#include "storageparser.h"
|
#include "storageparser.h"
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
#include <Swiften/TLS/CAPICertificate.h>
|
#include <Swiften/TLS/CAPICertificate.h>
|
||||||
#include "Swiften/TLS/Schannel/SchannelServerContext.h"
|
#include "Swiften/TLS/Schannel/SchannelServerContext.h"
|
||||||
#include "Swiften/TLS/Schannel/SchannelServerContextFactory.h"
|
#include "Swiften/TLS/Schannel/SchannelServerContextFactory.h"
|
||||||
|
@ -85,7 +85,7 @@ Component::Component(Swift::EventLoop *loop, Swift::NetworkFactories *factories,
|
||||||
if (!CONFIG_STRING(m_config, "service.cert").empty()) {
|
if (!CONFIG_STRING(m_config, "service.cert").empty()) {
|
||||||
LOG4CXX_INFO(logger, "Using PKCS#12 certificate " << CONFIG_STRING(m_config, "service.cert"));
|
LOG4CXX_INFO(logger, "Using PKCS#12 certificate " << CONFIG_STRING(m_config, "service.cert"));
|
||||||
LOG4CXX_INFO(logger, "SSLv23_server_method used.");
|
LOG4CXX_INFO(logger, "SSLv23_server_method used.");
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
TLSServerContextFactory *f = new SchannelServerContextFactory();
|
TLSServerContextFactory *f = new SchannelServerContextFactory();
|
||||||
m_server->addTLSEncryption(f, boost::make_shared<CAPICertificate>(CONFIG_STRING(m_config, "service.cert")));
|
m_server->addTLSEncryption(f, boost::make_shared<CAPICertificate>(CONFIG_STRING(m_config, "service.cert")));
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue