Skip to content

Commit 1c886fe

Browse files
committed
Nodepp | Cmake Fetching | V-1.3.0
1 parent 7f1f85b commit 1c886fe

File tree

3 files changed

+41
-19
lines changed

3 files changed

+41
-19
lines changed

CMakeLists.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
cmake_minimum_required(VERSION 4.0.0)
1+
cmake_minimum_required(VERSION 3.0.0)
2+
project(nodepp VERSION 1.3.0)
23

3-
project(nodepp VERSION 1.0.0)
4-
5-
set(CMAKE_CXX_STANDARD 17)
4+
set(CMAKE_CXX_STANDARD 11)
65
set(CMAKE_CXX_STANDARD_REQUIRED ON)
76
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8-
97
set(NODEPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
108

9+
# Search for ZLIB
10+
find_package(ZLIB REQUIRED)
11+
if(NOT ZLIB_FOUND)
12+
message(FATAL_ERROR "ZLIB not found. Please install libz-dev or equivalent files.")
13+
endif()
14+
1115
# Search for OpenSSL
1216
find_package(OpenSSL REQUIRED COMPONENTS Crypto SSL)
1317
if(NOT OpenSSL_FOUND)
14-
message(FATAL_ERROR "OpenSSL not found. Please install OpenSSL development files.")
18+
message(FATAL_ERROR "OpenSSL not found. Please install libopenssl-dev or equivalent files.")
1519
endif()
1620

17-
# Search for ZLIB
18-
find_package(ZLIB REQUIRED)
19-
if(NOT ZLIB_FOUND)
20-
message(FATAL_ERROR "ZLIB not found. Please install ZLIB development files.")
21-
endif()
21+
# interface-target
22+
add_library(nodepp INTERFACE)
23+
target_include_directories(nodepp INTERFACE ${NODEPP_INCLUDE_DIR})
24+
target_link_libraries(nodepp INTERFACE -lssl -lcrypto -lz $<$<OR:$<BOOL:${MSVC}>,$<STREQUAL:${CMAKE_SYSTEM_NAME},Windows>>:ws2_32> )

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,34 @@ Nodepp is a groundbreaking open-source project that simplifies C++ application d
44

55
One of the standout features of Nodepp is its 100% asynchronous architecture, powered by an internal Event Loop. This design efficiently manages Nodepp’s tasks, enabling you to develop scalable and concurrent applications with minimal code. Experience the power and flexibility of Nodepp as you streamline your development process and create robust applications effortlessly!
66

7-
## Dependencies
7+
🔗: [Nodepp The MOST Powerful Framework for Asynchronous Programming in C++](https://medium.com/p/c01b84eee67a)
8+
9+
## Dependencies & Cmake Integration
810
```bash
911
# Openssl
1012
🪟: pacman -S mingw-w64-ucrt-x86_64-openssl
1113
🐧: sudo apt install libssl-dev
12-
1314
# Zlib
1415
🪟: pacman -S mingw-w64-ucrt-x86_64-zlib
1516
🐧: sudo apt install zlib1g-dev
1617
```
18+
```bash
19+
include(FetchContent)
20+
21+
FetchContent_Declare(
22+
nodepp
23+
GIT_REPOSITORY https://github.com/NodeppOfficial/nodepp
24+
GIT_TAG origin/main
25+
GIT_PROGRESS ON
26+
)
27+
FetchContent_MakeAvailable(nodepp)
28+
29+
#[...]
30+
31+
target_link_libraries( #[...]
32+
PUBLIC nodepp #[...]
33+
)
34+
```
1735

1836
## Features
1937

@@ -223,5 +241,4 @@ If you want to contribute to **Nodepp**, you are welcome to do so! You can contr
223241
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/edbc_repo)
224242

225243
## License
226-
227-
**Nodepp** is distributed under the MIT License. See the LICENSE file for more details.
244+
**Nodepp** is distributed under the MIT License. See the LICENSE file for more details.

include/nodepp/stream.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,16 @@ namespace nodepp { namespace stream {
5757

5858
template< class T, class V >
5959
ulong await( const T& fa, const V& fb ){
60-
ulong out; /*-----------*/ generator::stream::pipe _read;
61-
while( fa.is_available() ){ out += fb.write( fa.read() ); }
60+
ulong out; /*-----------*/ generator::stream::pipe arg;
61+
fa.onData([&]( string_t data ){ out += data.size(); });
62+
process::await( arg, fa, fb );
6263
return out; }
6364

6465
template< class T >
6566
string_t await( const T& fp ){
66-
queue_t<string_t> out; generator::stream::pipe _read;
67-
while( fp.is_available() ){ out.push( fp.read() ); }
67+
queue_t<string_t> out; generator::stream::pipe arg;
68+
fp.onData([&]( string_t data ){ out.push(data); });
69+
process::await( arg, fp );
6870
return array_t<string_t>( out.data() ).join(""); }
6971

7072
}}

0 commit comments

Comments
 (0)