File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ check_cxx_compiler_flag(-fcoroutines _CXX_COROUTINES_SUPPORTS_CORO_FLAG)
115
115
116
116
if (_CXX_COROUTINES_SUPPORTS_MS_FLAG)
117
117
set (_CXX_COROUTINES_EXTRA_FLAGS "/await" )
118
+ if (CMAKE_CL_64 )
119
+ list (APPEND _CXX_COROUTINES_EXTRA_FLAGS "/await:heapelide" )
120
+ endif ()
118
121
elseif (_CXX_COROUTINES_SUPPORTS_TS_FLAG)
119
122
set (_CXX_COROUTINES_EXTRA_FLAGS "-fcoroutines-ts" )
120
123
elseif (_CXX_COROUTINES_SUPPORTS_CORO_FLAG)
Original file line number Diff line number Diff line change @@ -144,6 +144,14 @@ if(WIN32)
144
144
socket_recv_from_operation.cpp
145
145
)
146
146
list (APPEND sources ${win32Sources} )
147
+
148
+ list (APPEND libraries Ws2_32 Mswsock Synchronization)
149
+ list (APPEND compile_options /EHsc)
150
+
151
+ if ("${MSVC_VERSION} " VERSION_GREATER_EQUAL 1900)
152
+ # TODO remove this when experimental/non-experimental include are fixed
153
+ list (APPEND compile_definition _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING=1)
154
+ endif ()
147
155
endif ()
148
156
149
157
add_library (cppcoro
@@ -158,9 +166,11 @@ target_include_directories(cppcoro PUBLIC
158
166
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include >
159
167
$<INSTALL_INTERFACE:include >)
160
168
target_compile_features (cppcoro PUBLIC cxx_std_20)
169
+ target_compile_definitions (cppcoro PUBLIC ${compile_definition} )
170
+ target_compile_options (cppcoro PUBLIC ${compile_options} )
161
171
162
172
find_package (Coroutines COMPONENTS Experimental Final REQUIRED)
163
- target_link_libraries (cppcoro PUBLIC std::coroutines)
173
+ target_link_libraries (cppcoro PUBLIC std::coroutines ${libraries} )
164
174
165
175
install (TARGETS cppcoro EXPORT cppcoroTargets
166
176
LIBRARY DESTINATION lib
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/doctest/doctest.cmake)
5
5
6
6
find_package (Threads REQUIRED)
7
7
8
- add_library (tests-main SHARED
8
+ add_library (tests-main STATIC
9
9
main.cpp
10
10
counted.cpp
11
11
)
You can’t perform that action at this time.
0 commit comments