Added MSVC support to cmake files (not tested, but hopefully it works). Some tests are disabled due to lacking MSVC options.

This commit is contained in:
eidheim 2017-11-14 19:44:40 +01:00
commit 5a7c021dab
2 changed files with 15 additions and 9 deletions

View file

@ -5,7 +5,11 @@ project (Simple-Web-Server)
option(USE_STANDALONE_ASIO "set ON to use standalone Asio instead of Boost.Asio" OFF) option(USE_STANDALONE_ASIO "set ON to use standalone Asio instead of Boost.Asio" OFF)
option(BUILD_TESTING "set ON to build library tests" OFF) option(BUILD_TESTING "set ON to build library tests" OFF)
if(NOT MSVC)
add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion) add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion)
else()
add_compile_options(/W1)
endif()
add_library(simple-web-server INTERFACE) add_library(simple-web-server INTERFACE)

View file

@ -1,3 +1,4 @@
if(NOT MSVC)
add_compile_options(-fno-access-control) add_compile_options(-fno-access-control)
add_executable(io_test io_test.cpp) add_executable(io_test io_test.cpp)
@ -7,6 +8,7 @@ add_test(io_test io_test)
add_executable(parse_test parse_test.cpp) add_executable(parse_test parse_test.cpp)
target_link_libraries(parse_test simple-web-server) target_link_libraries(parse_test simple-web-server)
add_test(parse_test parse_test) add_test(parse_test parse_test)
endif()
if(OPENSSL_FOUND) if(OPENSSL_FOUND)
add_executable(crypto_test crypto_test.cpp) add_executable(crypto_test crypto_test.cpp)