Update build scripts for MSVC, MinGW

This commit is contained in:
Evgeniy
2016-09-23 14:35:46 +03:00
committed by Vinnie Falco
parent d5d8e2fcd2
commit 42073a925a
4 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,8 @@
1.0.0-b14
* Add missing rebind to handler_alloc
* Fix error handling in http server examples
* Fix CMake scripts for MinGW
--------------------------------------------------------------------------------

View File

@ -6,7 +6,7 @@ project (Beast)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
if (WIN32)
if (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /W4 /wd4100 /bigobj /D _WIN32_WINNT=0x0601 /D_SCL_SECURE_NO_WARNINGS=1 /D_CRT_SECURE_NO_WARNINGS=1")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
else()
@ -23,6 +23,10 @@ else()
"${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wpedantic")
endif()
if (MINGW)
link_libraries(${Boost_LIBRARIES} ws2_32 mswsock)
endif()
if ("${VARIANT}" STREQUAL "coverage")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

View File

@ -17,3 +17,7 @@ add_executable (lib-tests
if (NOT WIN32)
target_link_libraries(lib-tests ${Boost_LIBRARIES})
endif()
if (MINGW)
set_target_properties(lib-tests PROPERTIES COMPILE_FLAGS "-Wa,-mbig-obj")
endif()

View File

@ -25,6 +25,10 @@ if (NOT WIN32)
target_link_libraries(websocket-tests ${Boost_LIBRARIES} Threads::Threads)
endif()
if (MINGW)
set_target_properties(websocket-tests PROPERTIES COMPILE_FLAGS "-Wa,-mbig-obj -Og")
endif()
add_executable (websocket-echo
${BEAST_INCLUDES}
${EXTRAS_INCLUDES}