Skip to content

Commit 7b05985

Browse files
committed
delete all headers, main branch needs overhaul
- update dependency, branch internals needs complete rewrite
1 parent d04ac3f commit 7b05985

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+374
-53545
lines changed

CMakeLists.txt

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR})
2222
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/built")
2323
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
2424

25-
# if CMake versions earlier than 3.14 need to be supported see https://cmake.org/cmake/help/v3.14/module/FetchContent.html
2625
find_package(raii QUIET)
2726
if(NOT raii_FOUND)
2827
FetchContent_Declare(raii
29-
URL https://github.com/zelang-dev/c-raii/archive/refs/tags/1.3.6.zip
30-
URL_MD5 918bef3ec87af35cf3c0e059b6fb14fa
28+
URL https://github.com/zelang-dev/c-raii/archive/refs/heads/main.zip
29+
URL_MD5 f6f69f4e72680ec1a68f16b8b0b600fb
3130
)
3231
FetchContent_MakeAvailable(raii)
3332
endif()
@@ -45,36 +44,30 @@ file(GLOB lib_files
4544
${CMAKE_CURRENT_SOURCE_DIR}/src/*.c
4645
)
4746

48-
add_library(coroutine STATIC ${lib_files})
49-
set_property(TARGET coroutine PROPERTY POSITION_INDEPENDENT_CODE True)
50-
target_link_libraries(coroutine PUBLIC uv_a)
51-
52-
find_package(OpenSSL 0.9.8...<3.0.0)
53-
if(OPENSSL_FOUND AND WIN32)
54-
target_include_directories(coroutine BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR})
55-
add_definitions(-DOPENSSL_USE_STATIC_LIBS=TRUE)
56-
add_definitions(-DOPENSSL_MSVC_STATIC_RT=TRUE)
57-
add_definitions(-DNO_GETTIMEOFDAY)
58-
target_link_libraries(coroutine PUBLIC ${OPENSSL_CRYPTO_LIBRARY})
59-
target_link_libraries(coroutine PUBLIC ${OPENSSL_SSL_LIBRARY})
60-
else()
61-
find_package(LibreSSL QUIET)
62-
if(NOT LibreSSL_FOUND)
63-
set(LibreSSL_FOUND 1)
64-
FetchContent_Declare(libressl
65-
URL https://github.com/libressl/portable/releases/download/v3.9.2/libressl-3.9.2.tar.gz
66-
URL_MD5 0c9eb9b9b0f4e76e44f0647b21575391
67-
)
68-
FetchContent_MakeAvailable(libressl)
69-
endif()
70-
target_compile_definitions(crypto PUBLIC LIBRESSL_TESTS=OFF LIBRESSL_APPS=OFF)
71-
target_compile_definitions(ssl PUBLIC LIBRESSL_TESTS=OFF LIBRESSL_APPS=OFF)
72-
target_compile_definitions(tls PUBLIC LIBRESSL_TESTS=OFF LIBRESSL_APPS=OFF)
73-
target_link_libraries(coroutine PUBLIC crypto)
74-
target_link_libraries(coroutine PUBLIC ssl)
75-
endif()
47+
add_library(uv_coro STATIC ${lib_files})
48+
set_property(TARGET uv_coro PROPERTY POSITION_INDEPENDENT_CODE True)
49+
target_link_libraries(uv_coro PUBLIC uv_a)
50+
target_include_directories(uv_coro AFTER PUBLIC $<BUILD_INTERFACE:${RAII_INCLUDE_DIR} $<INSTALL_INTERFACE:${RAII_INCLUDE_DIR})
51+
target_link_libraries(uv_coro PUBLIC raii)
52+
7653

77-
target_include_directories(coroutine
54+
find_package(LibreSSL QUIET)
55+
if(NOT LibreSSL_FOUND)
56+
set(LibreSSL_FOUND 1)
57+
FetchContent_Declare(libressl
58+
URL https://github.com/libressl/portable/releases/download/v3.9.2/libressl-3.9.2.tar.gz
59+
URL_MD5 0c9eb9b9b0f4e76e44f0647b21575391
60+
)
61+
FetchContent_MakeAvailable(libressl)
62+
endif()
63+
target_compile_definitions(crypto PUBLIC LIBRESSL_TESTS=OFF LIBRESSL_APPS=OFF)
64+
target_compile_definitions(ssl PUBLIC LIBRESSL_TESTS=OFF LIBRESSL_APPS=OFF)
65+
target_compile_definitions(tls PUBLIC LIBRESSL_TESTS=OFF LIBRESSL_APPS=OFF)
66+
target_include_directories(uv_coro PUBLIC $<BUILD_INTERFACE:${LibreSSL_INCLUDE_DIR} $<INSTALL_INTERFACE:${LibreSSL_INCLUDE_DIR})
67+
target_link_libraries(uv_coro PUBLIC crypto)
68+
target_link_libraries(uv_coro PUBLIC ssl)
69+
70+
target_include_directories(uv_coro
7871
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
7972

8073
if(UNIX)
@@ -88,12 +81,8 @@ if(WIN32)
8881
add_definitions("/wd4244 /wd4267 /wd4033 /wd4715 /wd4311")
8982
endif()
9083

91-
target_include_directories(raii AFTER PUBLIC
92-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
93-
target_link_libraries(coroutine PUBLIC raii)
94-
9584
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
96-
option(BUILD_EXAMPLES "whether or not examples should be built" ON)
85+
option(BUILD_EXAMPLES "whether or not examples should be built" OFF)
9786

9887
if(BUILD_EXAMPLES)
9988
enable_testing()
@@ -121,5 +110,5 @@ set(CPACK_PACKAGE_VERSION 1.0.0)
121110
include(CPack)
122111

123112
set(CMAKE_INSTALL_CONFIG_NAME ${CMAKE_BUILD_TYPE})
124-
install(TARGETS ${coroutine} DESTINATION lib)
113+
install(TARGETS ${uv_coro} DESTINATION lib)
125114
install(DIRECTORY include/ DESTINATION include)

0 commit comments

Comments
 (0)