Skip to content

Commit

Permalink
initial code
Browse files Browse the repository at this point in the history
  • Loading branch information
Y. Velkov authored and Y. Velkov committed Aug 30, 2024
0 parents commit 0272f5e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
compile_commands.json
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project(coverage_action)


add_library(my_static_lib STATIC src/my_static_lib.cpp)
add_library(my_shared_lib SHARED src/my_shared_lib.cpp)


add_executable(main src/main.cpp)
target_link_libraries(main my_static_lib my_shared_lib)
11 changes: 11 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <iostream>

int method_in_shared_lib();
int method_in_static_lib();

int main() {
std::cout << "Hello, World!" << std::endl;
std::cout << "method_in_shared_lib() returned: " << method_in_shared_lib() << std::endl;
std::cout << "method_in_static_lib() returned: " << method_in_static_lib() << std::endl;
return 0;
}
4 changes: 4 additions & 0 deletions src/my_shared_lib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

int method_in_shared_lib() {
return 42;
}
4 changes: 4 additions & 0 deletions src/my_static_lib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

int method_in_static_lib() {
return 42;
}

0 comments on commit 0272f5e

Please sign in to comment.