Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
c3e3c2b
Changes to enable libcoro to be built with emscripten
Nov 2, 2023
370a19f
Suppressed githooks on readme.md which were messing it up
Nov 2, 2023
bd99a36
Removed the TL::expected dependency from submodules
Nov 2, 2023
2311875
Suppressed githooks on readme.md which were messing it up
Nov 2, 2023
4356be8
Using standard flag to see if std::jthreads are supported
Nov 2, 2023
a111e0a
Suppressed githooks on readme.md which were messing it up
Nov 2, 2023
2683bd8
Submodule stupidity
Nov 2, 2023
0019395
Burned tl::exepected as a dependency
Nov 2, 2023
0215fa3
undoing automated readme updates
Nov 2, 2023
7310d67
Removed jthreads as not supported by emsdk, tweaks to cmake and readme
Nov 10, 2023
be9d0df
Added a github CI pass for web assembly.
Nov 16, 2023
6a8adf6
Yaml syntax fix
Nov 16, 2023
6bcaab9
Yaml syntax fix
Nov 16, 2023
8debcdf
Yaml syntax fix
Nov 16, 2023
7eb39c1
Yaml syntax fix
Nov 16, 2023
69089f4
CI debugging
Nov 16, 2023
bf35100
CI debugging
Nov 16, 2023
4a828bb
CI debugging
Nov 16, 2023
76a2054
CI debugging
Nov 16, 2023
0d400d3
CI debugging
Nov 16, 2023
bf0197a
CI debugging
Nov 16, 2023
a3a6c29
CI debugging
Nov 16, 2023
81e97fd
CI debugging
Nov 16, 2023
8b61072
CI debugging
Nov 16, 2023
a00760e
CI debugging
Nov 16, 2023
52d9728
CI debugging
Nov 16, 2023
a2cd9f0
CI for wasm
Nov 16, 2023
a8bc980
Readme fixup
Nov 22, 2023
c9f7c45
Tweaks to fix deadlock with clang
Nov 26, 2023
683a6e7
changing memory order on atomic acquistion
Nov 29, 2023
8a047c9
memory order tweak
Nov 29, 2023
20e8fee
memory order tweak to thread pool size
Nov 29, 2023
b6557c4
Bypassing ctest and calling libcoro_test directly, outputing XML to s…
Nov 29, 2023
6f84eb9
CI tweak to check on the deadlocking test
Nov 29, 2023
7bc9fdd
CI tweak
Nov 29, 2023
1cdc528
Moved xml reporter setting into cmake, using ctest again in CI
Nov 29, 2023
21d41a3
Changes to enable libcoro to be built with emscripten
Nov 2, 2023
97abf71
Suppressed githooks on readme.md which were messing it up
Nov 2, 2023
329c8e8
Removed the TL::expected dependency from submodules
Nov 2, 2023
59d8b3e
Suppressed githooks on readme.md which were messing it up
Nov 2, 2023
05e6d09
Using standard flag to see if std::jthreads are supported
Nov 2, 2023
4b80c4f
Suppressed githooks on readme.md which were messing it up
Nov 2, 2023
5267ef7
Submodule stupidity
Nov 2, 2023
4a2603f
Burned tl::exepected as a dependency
Nov 2, 2023
e8057f1
undoing automated readme updates
Nov 2, 2023
a300169
Removed jthreads as not supported by emsdk, tweaks to cmake and readme
Nov 10, 2023
e22b100
Added a github CI pass for web assembly.
Nov 16, 2023
03d5e61
Yaml syntax fix
Nov 16, 2023
ecfc6a4
Yaml syntax fix
Nov 16, 2023
082a863
Yaml syntax fix
Nov 16, 2023
b29b8bd
Yaml syntax fix
Nov 16, 2023
ebd68e7
CI debugging
Nov 16, 2023
c30adfa
CI debugging
Nov 16, 2023
8394f0f
CI debugging
Nov 16, 2023
f1cefbb
CI debugging
Nov 16, 2023
a8d64c8
CI debugging
Nov 16, 2023
093719e
CI debugging
Nov 16, 2023
557730d
CI debugging
Nov 16, 2023
8fb078c
CI debugging
Nov 16, 2023
2872858
CI debugging
Nov 16, 2023
fb4083d
CI debugging
Nov 16, 2023
322453b
CI debugging
Nov 16, 2023
cc6731b
CI for wasm
Nov 16, 2023
eed86c1
Readme fixup
Nov 22, 2023
5512dde
changing memory order on atomic acquistion
Nov 29, 2023
a93ffdb
memory order tweak
Nov 29, 2023
daee82b
memory order tweak to thread pool size
Nov 29, 2023
fa2e8e3
Bypassing ctest and calling libcoro_test directly, outputing XML to s…
Nov 29, 2023
e6a27d2
CI tweak to check on the deadlocking test
Nov 29, 2023
744b911
CI tweak
Nov 29, 2023
ec7de3b
Moved xml reporter setting into cmake, using ctest again in CI
Nov 29, 2023
b1d1a9e
Merge fixes
Dec 1, 2023
e5beba3
Unit test defaulting to default reporter
Dec 1, 2023
cbbe8b0
Tweaks
Dec 1, 2023
0f2e6a5
Reverting out memory_order::seq_cst as josh fix the problem and they …
Dec 1, 2023
b1c02f5
Fixed readme weirdness (again)
Dec 1, 2023
aa48ccc
Fixed readme weirdness (again (again))
Dec 1, 2023
faea978
Fixed typo
Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .githooks/readme-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Completed 10000000 requests
Finished 10000000 requests


Server Software:
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8888

Expand Down Expand Up @@ -412,8 +412,6 @@ This project uses git submodules, to properly checkout this project use:
This project depends on the following git sub-modules:
* [libc-ares](https://github.com/c-ares/c-ares) For async DNS resolver, this is a git submodule.
* [catch2](https://github.com/catchorg/Catch2) For testing, this is embedded in the `test/` directory.
* [expected](https://github.com/TartanLlama/expected) For results on operations that can fail, this is a git submodule in the `vendor/` directory.
* `-std=c++23` if it supports `__cpp_lib_expected` will use `std::expected` instead.

#### Building
mkdir Release && cd Release
Expand Down
49 changes: 47 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ jobs:
run: |
cd build-release-clang++-feature-networking-disabled
ctest -VV

build-fedora-32-to-37:
name: fedora-${{ matrix.fedora_version }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -281,4 +280,50 @@ jobs:
- name: test-release-cl
run: |
cd build-release-cl
ctest --build-config Release -VV
build-emscripten-3_1_45:
name: emscripten-3_1_45
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
steps:
- name: apt
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y \
cmake \
git \
ninja-build
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: install-emsdk
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.45
./emsdk activate 3.1.45
- name: build-release-emscripten
run: |
cd emsdk
. ./emsdk_env.sh
cd ..
mkdir build-release-emscripten
cd build-release-emscripten
emcmake cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
..
ninja
- name: test-release-emscripten
run: |
cd emsdk
. ./emsdk_env.sh
cd ../build-release-emscripten
node --experimental-wasm-eh ./test/libcoro_test.js
7 changes: 2 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "vendor/c-ares/c-ares"]
path = vendor/c-ares/c-ares
url = https://github.com/c-ares/c-ares.git
[submodule "vendor/tartanllama/expected"]
path = vendor/tartanllama/expected
url = https://github.com/jstranik/expected.git
path = vendor/c-ares/c-ares
url = https://github.com/c-ares/c-ares.git
31 changes: 20 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ option(LIBCORO_EXTERNAL_DEPENDENCIES "Use Cmake find_package to resolve dependen
option(LIBCORO_BUILD_TESTS "Build the tests, Default=ON." ON)
option(LIBCORO_CODE_COVERAGE "Enable code coverage, tests must also be enabled, Default=OFF" OFF)
option(LIBCORO_BUILD_EXAMPLES "Build the examples, Default=ON." ON)
cmake_dependent_option(LIBCORO_FEATURE_PLATFORM "Include linux platform features, Default=ON." ON "NOT MSVC" OFF)
cmake_dependent_option(LIBCORO_FEATURE_NETWORKING "Include networking features, Default=ON." ON "NOT MSVC" OFF)
cmake_dependent_option(LIBCORO_FEATURE_SSL "Include SSL encryption features, Default=ON." ON "NOT MSVC" OFF)

cmake_dependent_option(LIBCORO_FEATURE_PLATFORM "Include linux platform features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF)
cmake_dependent_option(LIBCORO_FEATURE_NETWORKING "Include networking features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF)
cmake_dependent_option(LIBCORO_FEATURE_SSL "Include SSL encryption features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF)

message("${PROJECT_NAME} LIBCORO_EXTERNAL_DEPENDENCIES = ${LIBCORO_EXTERNAL_DEPENDENCIES}")
message("${PROJECT_NAME} LIBCORO_BUILD_TESTS = ${LIBCORO_BUILD_TESTS}")
Expand All @@ -39,7 +40,6 @@ if(LIBCORO_EXTERNAL_DEPENDENCIES)
if(LIBCORO_FEATURE_NETWORKING)
find_package(c-ares CONFIG REQUIRED)
endif()
find_package(tl-expected CONFIG REQUIRED)
else()
if(NOT LIBCORO_BUILD_TESTS)
# Disable testing in expected
Expand All @@ -51,7 +51,6 @@ else()
set(CARES_INSTALL OFF CACHE INTERNAL "")
add_subdirectory(vendor/c-ares/c-ares)
endif()
add_subdirectory(vendor/tartanllama/expected)
endif()

set(LIBCORO_SOURCE_FILES
Expand Down Expand Up @@ -112,18 +111,28 @@ if(LIBCORO_FEATURE_NETWORKING)
endif()
endif()

if(DEFINED EMSCRIPTEN)
add_compile_options(-fwasm-exceptions)
add_compile_options(-pthread)
add_compile_options(-matomics)

add_link_options(-fwasm-exceptions)
add_link_options(-pthread)
add_link_options(-sPROXY_TO_PTHREAD)
add_link_options(-sALLOW_MEMORY_GROWTH)
add_link_options(-sEXIT_RUNTIME)
endif()

add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX PREFIX "")
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
target_include_directories(${PROJECT_NAME} PUBLIC include)
if(MSVC)
# Not sure why this is only needed on Windows.
target_include_directories(${PROJECT_NAME} PUBLIC vendor/tartanllama/expected/include)
endif()

if(LIBCORO_FEATURE_PLATFORM)
target_link_libraries(${PROJECT_NAME} PUBLIC pthread tl::expected)
target_link_libraries(${PROJECT_NAME} PUBLIC pthread)
target_compile_definitions(${PROJECT_NAME} PUBLIC LIBCORO_FEATURE_PLATFORM)
endif()
endif()

if(LIBCORO_FEATURE_NETWORKING)
target_link_libraries(${PROJECT_NAME} PUBLIC c-ares::cares)
target_compile_definitions(${PROJECT_NAME} PUBLIC LIBCORO_FEATURE_NETWORKING)
Expand Down
4 changes: 3 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
target_compile_options(coro_task PUBLIC -Wall -Wextra -pipe)
target_compile_options(coro_generator PUBLIC -Wall -Wextra -pipe)
target_compile_options(coro_event PUBLIC -Wall -Wextra -pipe)
target_compile_options(coro_latch PUBLIC -Wall -Wextra -pipe)
if(LIBCORO_FEATURE_PLATFORM)
target_compile_options(coro_latch PUBLIC -Wall -Wextra -pipe)
endif()
target_compile_options(coro_mutex PUBLIC -Wall -Wextra -pipe)
target_compile_options(coro_thread_pool PUBLIC -Wall -Wextra -pipe)
target_compile_options(coro_semaphore PUBLIC -Wall -Wextra -pipe)
Expand Down
Loading