File tree 5 files changed +22
-7
lines changed
5 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ set(CMAKE_CXX_EXTENSIONS OFF)
5
5
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
6
6
7
7
list (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR} /cmake" )
8
- include (CTest)
9
8
10
9
add_subdirectory (lib)
10
+
11
+ enable_testing ()
11
12
if (BUILD_TESTING)
12
13
add_subdirectory (test )
13
14
endif ()
@@ -20,10 +21,10 @@ configure_file(cmake/cppcoroConfig.cmake
20
21
COPYONLY )
21
22
22
23
set (config_package_location lib/cmake/cppcoro)
23
- install (DIRECTORY include
24
- DESTINATION .
24
+ install (DIRECTORY include /cppcoro
25
+ DESTINATION include
25
26
COMPONENT Devel)
26
- install (FILES cmake/FindCppcoroCoroutines .cmake
27
+ install (FILES cmake/FindCoroutines .cmake
27
28
DESTINATION ${config_package_location}
28
29
COMPONENT Devel)
29
30
install (EXPORT cppcoroTargets
Original file line number Diff line number Diff line change @@ -110,11 +110,15 @@ cmake_push_check_state()
110
110
set (CMAKE_REQUIRED_QUIET ${Coroutines_FIND_QUIETLY} )
111
111
112
112
check_cxx_compiler_flag(/await _CXX_COROUTINES_SUPPORTS_MS_FLAG)
113
+ check_cxx_compiler_flag(/await:heapelide _CXX_COROUTINES_SUPPORTS_MS_HEAPELIDE_FLAG)
113
114
check_cxx_compiler_flag(-fcoroutines-ts _CXX_COROUTINES_SUPPORTS_TS_FLAG)
114
115
check_cxx_compiler_flag(-fcoroutines _CXX_COROUTINES_SUPPORTS_CORO_FLAG)
115
116
116
117
if (_CXX_COROUTINES_SUPPORTS_MS_FLAG)
117
118
set (_CXX_COROUTINES_EXTRA_FLAGS "/await" )
119
+ if (_CXX_COROUTINES_SUPPORTS_MS_HEAPELIDE_FLAG AND CMAKE_SIZEOF_VOID_P GREATER_EQUAL 8)
120
+ list (APPEND _CXX_COROUTINES_EXTRA_FLAGS "/await:heapelide" )
121
+ endif ()
118
122
elseif (_CXX_COROUTINES_SUPPORTS_TS_FLAG)
119
123
set (_CXX_COROUTINES_EXTRA_FLAGS "-fcoroutines-ts" )
120
124
elseif (_CXX_COROUTINES_SUPPORTS_CORO_FLAG)
Original file line number Diff line number Diff line change 1
1
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} )
2
2
3
3
include (CMakeFindDependencyMacro)
4
- find_dependency(CppcoroCoroutines QUIET REQUIRED)
4
+ find_dependency(Coroutines QUIET REQUIRED)
5
5
6
6
include ("${CMAKE_CURRENT_LIST_DIR} /cppcoroTargets.cmake" )
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