From 9a708dc7a064039fff4f6aa5e9b943200729d009 Mon Sep 17 00:00:00 2001 From: "U-ole-PC\\ole" Date: Tue, 29 Sep 2015 15:19:59 +0200 Subject: [PATCH] Now supports MSYS2, and parse_test compile with g++-5.2. --- CMakeLists.txt | 16 +++++++--------- test/CMakeLists.txt | 7 +++++++ test/parse_test.cpp | 2 -- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 502cb6d..63d7c4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,35 +16,33 @@ endif() #Only tested with versions 1.55 and 1.56 find_package(Boost 1.54.0 COMPONENTS regex system thread coroutine context filesystem REQUIRED) -message("Boost include dir: ${Boost_INCLUDE_DIR}") -message("Boost libraries: ${Boost_LIBRARIES}") include_directories(${Boost_INCLUDE_DIR}) if(APPLE) - set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") + set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") endif() #TODO: add requirement for version 1.0.1g (can it be done in one line?) find_package(OpenSSL REQUIRED) -message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}") -message("OpenSSL SSL libraries: ${OPENSSL_SSL_LIBRARIES}") -message("OpenSSL crypto libraries: ${OPENSSL_CRYPTO_LIBRARIES}") include_directories(${OPENSSL_INCLUDE_DIR}) find_package(Threads REQUIRED) -message("Threads libraries/flag: ${CMAKE_THREAD_LIBS_INIT}") include_directories(.) add_executable(https_examples https_examples.cpp) target_link_libraries(https_examples ${Boost_LIBRARIES}) -target_link_libraries(https_examples ${OPENSSL_SSL_LIBRARIES}) -target_link_libraries(https_examples ${OPENSSL_CRYPTO_LIBRARIES}) +target_link_libraries(https_examples ${OPENSSL_LIBRARIES}) target_link_libraries(https_examples ${CMAKE_THREAD_LIBS_INIT}) add_executable(http_examples http_examples.cpp) target_link_libraries(http_examples ${Boost_LIBRARIES}) target_link_libraries(http_examples ${CMAKE_THREAD_LIBS_INIT}) +if(MSYS) + target_link_libraries(http_examples ws2_32 wsock32) + target_link_libraries(https_examples ws2_32 wsock32) +endif() + enable_testing() add_subdirectory(test) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cadba79..27a7cff 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,11 @@ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-access-control") + add_executable(parse_test parse_test.cpp) target_link_libraries(parse_test ${Boost_LIBRARIES}) target_link_libraries(parse_test ${CMAKE_THREAD_LIBS_INIT}) + +if(MSYS) + target_link_libraries(parse_test ws2_32 wsock32) +endif() + add_test(parse_test parse_test) diff --git a/test/parse_test.cpp b/test/parse_test.cpp index 5888a8d..90ddfe5 100644 --- a/test/parse_test.cpp +++ b/test/parse_test.cpp @@ -1,5 +1,3 @@ -#define private public - #include "server_http.hpp" #include "client_http.hpp" #include