Skip to content

Commit 1e4dbaa

Browse files
committed
update
1 parent d21aa90 commit 1e4dbaa

File tree

6 files changed

+66
-0
lines changed

6 files changed

+66
-0
lines changed

play/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,26 @@ add_executable(server
1010
target_link_libraries(server
1111
PRIVATE
1212
absl::status
13+
lib_a
14+
lib_b
15+
)
16+
17+
add_library(lib_a
18+
lib_a.h
19+
lib_a.cc
20+
)
21+
22+
target_link_libraries(lib_a
23+
PRIVATE
24+
lib_b
25+
)
26+
27+
add_library(lib_b
28+
lib_b.h
29+
lib_b.cc
30+
)
31+
32+
target_link_libraries(lib_b
33+
PRIVATE
34+
lib_a
1335
)

play/lib_a.cc

Whitespace-only changes.

play/lib_a.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
#pragma once
3+
4+
#include <iostream>
5+
6+
#include "lib_b.h"
7+
8+
namespace lib_a {
9+
void lib_a_function() {
10+
std::cout << "lib_a_function called" << std::endl;
11+
lib_b::lib_b_self();
12+
}
13+
14+
void lib_a_self() {
15+
std::cout << "lib_a_self called" << std::endl;
16+
}
17+
}

play/lib_b.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <iostream>
2+
3+
namespace lib_a {
4+
void lib_a_function() {
5+
// This function is intentionally left empty.
6+
std::cout << "lib_a_function called" << std::endl;
7+
}
8+
}

play/lib_b.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
#include <iostream>
4+
5+
#include "lib_a.h"
6+
7+
namespace lib_b {
8+
void lib_b_function() {
9+
std::cout << "lib_b_function called" << std::endl;
10+
lib_a::lib_a_self();
11+
}
12+
13+
void lib_b_self() {
14+
std::cout << "lib_b_self called" << std::endl;
15+
}
16+
}

play/main.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "absl/status/status.h"
22
#include <iostream>
33

4+
#include "lib_a.h"
5+
#include "lib_b.h"
6+
47
int main() {
58
absl::Status status = absl::InternalError("Something went wrong!");
69
if (!status.ok()) std::cerr << "Error: " << status.message() << std::endl;

0 commit comments

Comments
 (0)