Skip to content

Commit

Permalink
added libraries.json & cleaned up cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Oct 17, 2023
1 parent 6319f90 commit 5fcc206
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.12...3.20)

if(BOOST_SUPERPROJECT_VERSION)
set(BOOST_REQUESTS_VERSION ${BOOST_SUPERPROJECT_VERSION})
set(BOOST_COBALT_VERSION ${BOOST_SUPERPROJECT_VERSION})
endif()

project(boost_cobalt VERSION "${BOOST_COBALT_VERSION}" LANGUAGES CXX)
Expand All @@ -26,7 +26,6 @@ if (NOT BOOST_COBALT_IS_ROOT)
# https://www.boost.org/LICENSE_1_0.txt

# 12 for cxx_std_20
cmake_minimum_required(VERSION 3.12...3.20)

project(boost_cobalt VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)

Expand Down
4 changes: 2 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ foreach(SRC ${ALL_EXAMPLES})
if (NAME STREQUAL ticker)
if (TARGET Boost::json)
add_executable(boost_cobalt_example_${NAME} ${SRC} )
target_link_libraries(boost_cobalt_example_${NAME} PUBLIC Boost::cobalt Boost::json Boost::url ${OPENSSL_LIBRARIES})
target_link_libraries(boost_cobalt_example_${NAME} PUBLIC Boost::cobalt Boost::json Boost::url OpenSSL::SSL)
target_compile_definitions(boost_cobalt_example_${NAME} PUBLIC)
endif()
continue()
Expand Down Expand Up @@ -41,6 +41,6 @@ foreach(SRC ${ALL_EXAMPLES})
endif()

add_executable(boost_cobalt_example_${NAME} ${SRC})
target_link_libraries(boost_cobalt_example_${NAME} PUBLIC Boost::cobalt ${OPENSSL_LIBRARIES})
target_link_libraries(boost_cobalt_example_${NAME} PUBLIC Boost::cobalt OpenSSL::SSL)
target_compile_definitions(boost_cobalt_example_${NAME} PUBLIC)
endforeach()
18 changes: 18 additions & 0 deletions meta/libraries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"key": "cobalt",
"name": "Cobalt",
"authors": [
"Klemens Morgenstern"
],
"maintainers": [
"Klemens Morgenstern <klemens -dot- d -dot- morgenstern -at- gmail.com>"
],
"description": "Coroutines. Basic Algorithms & Types",
"category": [
"Concurrent",
"Coroutines",
"Awaitables",
"Asynchronous"
],
"cxxstd": "20"
}
15 changes: 9 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
enable_testing()
if(NOT TARGET tests)
add_custom_target(tests)
set_property(TARGET tests PROPERTY FOLDER _deps)
endif()

add_library(boost_cobalt_static_tests concepts.cpp util.cpp)
target_link_libraries(boost_cobalt_static_tests Boost::headers)
target_compile_features(boost_cobalt_static_tests PUBLIC cxx_std_20)

target_link_libraries(boost_cobalt_static_tests Boost::cobalt)

add_executable(boost_cobalt_main main.cpp)
add_executable(boost_cobalt_main_compile main_compile.cpp)
Expand All @@ -16,7 +17,9 @@ target_link_libraries(boost_cobalt_main Boost::cobalt)
target_link_libraries(boost_cobalt_main_compile Boost::cobalt)
target_link_libraries(boost_cobalt_basic_tests Boost::cobalt)

add_test(NAME boost_cobalt-main COMMAND boost_cobalt_main)
add_test(NAME boost_cobalt-basic_tests COMMAND boost_cobalt_basic_tests)
add_test(NAME boost_cobalt_main COMMAND boost_cobalt_main)
add_test(NAME boost_cobalt_basic_tests COMMAND boost_cobalt_basic_tests)
target_compile_features(boost_cobalt PUBLIC cxx_std_20)

add_dependencies(tests boost_cobalt_main boost_cobalt_basic_tests boost_cobalt_static_tests)

0 comments on commit 5fcc206

Please sign in to comment.