Skip to content

Commit 7f011a0

Browse files
committed
clang and cmake format
1 parent fbb856f commit 7f011a0

File tree

9 files changed

+52
-85
lines changed

9 files changed

+52
-85
lines changed

demos/comprehensive/idl/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
cmake_minimum_required(VERSION 3.24)
77

88
# Generate code from IDL Note: protocol_buffers is disabled because rpc::optimistic_ptr has no protobuf equivalent
9-
canopygenerate(
9+
CanopyGenerate(
1010
comprehensive
1111
comprehensive/comprehensive.idl
1212
${CMAKE_CURRENT_SOURCE_DIR}
@@ -16,12 +16,9 @@ canopygenerate(
1616
yas_compressed_binary
1717
yas_json
1818
protocol_buffers
19-
mock
20-
comprehensive/comprehensive_mock.h
21-
include_paths
22-
${CMAKE_CURRENT_SOURCE_DIR}/.
23-
install_dir
24-
${GENERATED_INSTALL_DIR})
19+
mock comprehensive/comprehensive_mock.h
20+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
21+
install_dir ${GENERATED_INSTALL_DIR})
2522

2623
# Suppress generator bug warning (misleading indentation in generated code)
2724
target_compile_options(comprehensive_idl PRIVATE -Wno-misleading-indentation)

demos/websocket/idl/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
cmake_minimum_required(VERSION 3.24)
77

8-
canopygenerate(
8+
CanopyGenerate(
99
websocket_demo
1010
websocket_demo/websocket_demo.idl
1111
${CMAKE_CURRENT_SOURCE_DIR}
@@ -15,12 +15,9 @@ canopygenerate(
1515
yas_compressed_binary
1616
yas_json
1717
protocol_buffers
18-
dependencies
19-
rpc_types_idl
20-
install_dir
21-
${GENERATED_INSTALL_DIR}
22-
include_paths
23-
${CMAKE_CURRENT_SOURCE_DIR}/.)
18+
dependencies rpc_types_idl
19+
install_dir ${GENERATED_INSTALL_DIR}
20+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.)
2421

2522
# Generate JavaScript protobuf files for WebSocket demo
2623
find_program(NPM_EXECUTABLE npm)

demos/websocket/server/http_client_connection.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,15 @@ namespace websocket_demo
169169
// 3. Parse the HTTP request
170170
// Debug: print first 100 bytes of received data
171171
std::cout << "Received " << rspan.size() << " bytes, first bytes: ";
172-
for (size_t i = 0; i < std::min(size_t(100), rspan.size()); i++) {
172+
for (size_t i = 0; i < std::min(size_t(100), rspan.size()); i++)
173+
{
173174
unsigned char c = static_cast<unsigned char>(rspan.data()[i]);
174-
if (c >= 32 && c < 127) {
175+
if (c >= 32 && c < 127)
176+
{
175177
std::cout << c;
176-
} else {
178+
}
179+
else
180+
{
177181
std::cout << "\\x" << std::hex << (int)c << std::dec;
178182
}
179183
}

rpc/interfaces/CMakeLists.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
cmake_minimum_required(VERSION 3.24)
77

8-
canopygenerate(
8+
CanopyGenerate(
99
rpc_types
1010
rpc/rpc_types.idl
1111
${CMAKE_CURRENT_SOURCE_DIR}
@@ -15,11 +15,6 @@ canopygenerate(
1515
yas_compressed_binary
1616
yas_json
1717
protocol_buffers
18-
include_paths
19-
${CMAKE_CURRENT_SOURCE_DIR}/.
20-
install_dir
21-
${GENERATED_INSTALL_DIR}
22-
additional_headers
23-
stdint.h
24-
no_include_rpc_headers
25-
ON)
18+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
19+
install_dir ${GENERATED_INSTALL_DIR}
20+
additional_headers stdint.h no_include_rpc_headers ON)

tests/idls/CMakeLists.txt

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
cmake_minimum_required(VERSION 3.24)
77

8-
canopygenerate(
8+
CanopyGenerate(
99
example_shared
1010
example_shared/example_shared.idl
1111
${CMAKE_CURRENT_SOURCE_DIR}
@@ -15,14 +15,11 @@ canopygenerate(
1515
yas_compressed_binary
1616
yas_json
1717
protocol_buffers
18-
mock
19-
example_shared/example_shared_mock.h
20-
include_paths
21-
${CMAKE_CURRENT_SOURCE_DIR}/.
22-
install_dir
23-
${GENERATED_INSTALL_DIR})
18+
mock example_shared/example_shared_mock.h
19+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
20+
install_dir ${GENERATED_INSTALL_DIR})
2421

25-
canopygenerate(
22+
CanopyGenerate(
2623
example_import
2724
example_import/example_import.idl
2825
${CMAKE_CURRENT_SOURCE_DIR}
@@ -32,16 +29,12 @@ canopygenerate(
3229
yas_compressed_binary
3330
yas_json
3431
protocol_buffers
35-
mock
36-
example_import/example_import_mock.h
37-
dependencies
38-
example_shared_idl
39-
include_paths
40-
${CMAKE_CURRENT_SOURCE_DIR}/.
41-
install_dir
42-
${GENERATED_INSTALL_DIR})
32+
mock example_import/example_import_mock.h
33+
dependencies example_shared_idl
34+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
35+
install_dir ${GENERATED_INSTALL_DIR})
4336

44-
canopygenerate(
37+
CanopyGenerate(
4538
example
4639
example/example.idl
4740
${CMAKE_CURRENT_SOURCE_DIR}
@@ -51,17 +44,12 @@ canopygenerate(
5144
yas_compressed_binary
5245
yas_json
5346
protocol_buffers
54-
mock
55-
example/example_mock.h
56-
dependencies
57-
example_import_idl
58-
example_shared_idl
59-
include_paths
60-
${CMAKE_CURRENT_SOURCE_DIR}/.
61-
install_dir
62-
${GENERATED_INSTALL_DIR})
47+
mock example/example_mock.h
48+
dependencies example_import_idl example_shared_idl
49+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
50+
install_dir ${GENERATED_INSTALL_DIR})
6351

64-
canopygenerate(
52+
CanopyGenerate(
6553
fuzz_test
6654
fuzz_test/fuzz_test.idl
6755
${CMAKE_CURRENT_SOURCE_DIR}
@@ -71,7 +59,5 @@ canopygenerate(
7159
yas_compressed_binary
7260
yas_json
7361
protocol_buffers
74-
mock
75-
fuzz_test/fuzz_test_mock.h
76-
include_paths
77-
${CMAKE_CURRENT_SOURCE_DIR}/.)
62+
mock fuzz_test/fuzz_test_mock.h
63+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.)

tests/unit_tests/member_ptr/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include_directories(${PROJECT_SOURCE_DIR}/rpc/include)
99
# Only build member_ptr_test for non-coroutine builds This test is not compatible with coroutine mode
1010
if(NOT CANOPY_BUILD_COROUTINE)
1111
# idl
12-
canopygenerate(
12+
CanopyGenerate(
1313
member_ptr_test
1414
member_ptr_test/member_ptr_test.idl
1515
${CMAKE_CURRENT_SOURCE_DIR}
@@ -18,12 +18,9 @@ if(NOT CANOPY_BUILD_COROUTINE)
1818
yas_binary
1919
yas_compressed_binary
2020
yas_json
21-
include_paths
22-
${CMAKE_CURRENT_SOURCE_DIR}/.
23-
dependencies
24-
rpc_types_idl
25-
install_dir
26-
${GENERATED_INSTALL_DIR})
21+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
22+
dependencies rpc_types_idl
23+
install_dir ${GENERATED_INSTALL_DIR})
2724

2825
# Define the test executable for rpc::member_ptr
2926
add_executable(member_ptr_test member_ptr_test.cpp)

transports/dodgy/interface/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.24)
99
if(CANOPY_BUILD_COROUTINE)
1010

1111
# idl
12-
canopygenerate(
12+
CanopyGenerate(
1313
dodgy
1414
dodgy/dodgy.idl
1515
${CMAKE_CURRENT_SOURCE_DIR}
@@ -18,11 +18,8 @@ if(CANOPY_BUILD_COROUTINE)
1818
yas_binary
1919
yas_compressed_binary
2020
yas_json
21-
include_paths
22-
${CMAKE_CURRENT_SOURCE_DIR}/.
23-
dependencies
24-
rpc_types_idl
25-
install_dir
26-
${GENERATED_INSTALL_DIR})
21+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
22+
dependencies rpc_types_idl
23+
install_dir ${GENERATED_INSTALL_DIR})
2724

2825
endif()

transports/spsc/interface/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ cmake_minimum_required(VERSION 3.24)
99
if(CANOPY_BUILD_COROUTINE)
1010

1111
# idl
12-
canopygenerate(
12+
CanopyGenerate(
1313
spsc
1414
spsc/spsc.idl
1515
${CMAKE_CURRENT_SOURCE_DIR}
1616
${CMAKE_BINARY_DIR}/generated
1717
""
1818
yas_binary
1919
yas_json
20-
include_paths
21-
${CMAKE_CURRENT_SOURCE_DIR}/.
22-
dependencies
23-
rpc_types_idl
24-
install_dir
25-
${GENERATED_INSTALL_DIR})
20+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
21+
dependencies rpc_types_idl
22+
install_dir ${GENERATED_INSTALL_DIR})
2623

2724
endif()

transports/tcp/interface/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.24)
99
if(CANOPY_BUILD_COROUTINE)
1010

1111
# idl
12-
canopygenerate(
12+
CanopyGenerate(
1313
tcp
1414
tcp/tcp.idl
1515
${CMAKE_CURRENT_SOURCE_DIR}
@@ -18,11 +18,8 @@ if(CANOPY_BUILD_COROUTINE)
1818
yas_binary
1919
yas_compressed_binary
2020
yas_json
21-
include_paths
22-
${CMAKE_CURRENT_SOURCE_DIR}/.
23-
dependencies
24-
rpc_types_idl
25-
install_dir
26-
${GENERATED_INSTALL_DIR})
21+
include_paths ${CMAKE_CURRENT_SOURCE_DIR}/.
22+
dependencies rpc_types_idl
23+
install_dir ${GENERATED_INSTALL_DIR})
2724

2825
endif()

0 commit comments

Comments
 (0)