Skip to content

Commit 062fa39

Browse files
committed
Change to CMake configuration to build library + examples + tests with MSVC2015. Some tests do not pass, though.
1 parent 6a7e92c commit 062fa39

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CMakeLists.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
100100
endif()
101101

102102

103+
if (MSVC)
104+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
105+
set(gtest_force_shared_crt true)
106+
endif()
107+
103108
if (Boost_FOUND)
104109
if (MSVC)
105110
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
@@ -108,6 +113,7 @@ if (Boost_FOUND)
108113
add_definitions(-D_WIN32_WINNT=0x0501)
109114
endif(WIN32)
110115
include_directories(${Boost_INCLUDE_DIRS})
116+
link_directories(${Boost_LIBRARY_DIRS})
111117

112118
enable_testing()
113119
add_subdirectory(libs/network/src)
@@ -120,10 +126,6 @@ if (Boost_FOUND)
120126
endif (CPP-NETLIB_BUILD_EXAMPLES)
121127
endif(Boost_FOUND)
122128

123-
if (MSVC)
124-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
125-
endif()
126-
127129
enable_testing()
128130

129131
set(CPP-NETLIB_LIBRARIES ${Boost_LIBRARIES} CACHE INTERNAL "Dependent libraries for header-only use")

0 commit comments

Comments
 (0)