Skip to content

Commit f066bc2

Browse files
authored
Elasticurl (aws#111)
- elasticurl_cpp - add h2 unittest to HttpClientTest - TODO: We still use command_line_parser from C land. C++ cli_parser probably will be added to the TODO list.
1 parent 89917f8 commit f066bc2

File tree

19 files changed

+681
-27
lines changed

19 files changed

+681
-27
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
run: |
100100
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
101101
chmod a+x builder
102-
./builder build -p aws-crt-cpp --spec=downstream --target=${{matrix.arch}}
102+
./builder build -p aws-crt-cpp --spec=downstream --target=${{matrix.arch}} run_tests=false
103103
104104
105105

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
.idea
22
.DS_Store
33

4+
#cmake artifacts
5+
dependencies
6+
_build
7+
build
8+
_build_*
9+
cmake-build*
10+
411
include/aws/crt/Config.h

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
257257
if (NOT CMAKE_CROSSCOMPILING)
258258
if (BUILD_TESTING)
259259
add_subdirectory(tests)
260+
add_subdirectory(bin/elasticurl_cpp)
260261
endif()
261262
endif()
262263

bin/elasticurl_cpp/CMakeLists.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
project(elasticurl_cpp CXX)
2+
3+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/lib/cmake")
4+
5+
file(GLOB ELASTICURL_CPP_SRC
6+
"*.cpp"
7+
)
8+
9+
set(ELASTICURL_CPP_PROJECT_NAME elasticurl_cpp)
10+
add_executable(${ELASTICURL_CPP_PROJECT_NAME} ${ELASTICURL_CPP_SRC})
11+
12+
set_target_properties(${ELASTICURL_CPP_PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
13+
set_target_properties(${ELASTICURL_CPP_PROJECT_NAME} PROPERTIES CXX_STANDARD ${CMAKE_CXX_STANDARD})
14+
15+
#set warnings
16+
if (MSVC)
17+
target_compile_options(${ELASTICURL_CPP_PROJECT_NAME} PRIVATE /W4 /WX)
18+
else ()
19+
target_compile_options(${ELASTICURL_CPP_PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic -Werror)
20+
endif ()
21+
22+
23+
if (CMAKE_BUILD_TYPE STREQUAL "" OR CMAKE_BUILD_TYPE MATCHES Debug)
24+
target_compile_definitions(${ELASTICURL_CPP_PROJECT_NAME} PRIVATE "-DDEBUG_BUILD")
25+
endif ()
26+
27+
target_include_directories(${ELASTICURL_CPP_PROJECT_NAME} PUBLIC
28+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
29+
$<INSTALL_INTERFACE:include>)
30+
31+
target_link_libraries(${ELASTICURL_CPP_PROJECT_NAME} aws-crt-cpp)
32+
33+
if (BUILD_SHARED_LIBS AND NOT WIN32)
34+
message(INFO " elasticurl will be built with shared libs, but you may need to set LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib to run the application")
35+
endif()
36+
37+
install(TARGETS ${ELASTICURL_CPP_PROJECT_NAME}
38+
EXPORT ${ELASTICURL_CPP_PROJECT_NAME}-targets
39+
COMPONENT Runtime
40+
RUNTIME
41+
DESTINATION bin
42+
COMPONENT Runtime)

0 commit comments

Comments
 (0)