Skip to content

Commit

Permalink
See issue #76: Update targets with libraries and binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshjoshi committed Aug 26, 2022
1 parent 68eedd1 commit f5b14a3
Show file tree
Hide file tree
Showing 17 changed files with 18,050 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ project(pantscc
0.0.1
)

set(CMAKE_VERBOSE_MAKEFILE TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
Expand Down
7 changes: 6 additions & 1 deletion examples/cc/app/src/BUILD.pants
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
cc_sources()
cc_sources(name="sources")

cc_binary(
name="exe",
dependencies=[":sources"]
)
4 changes: 4 additions & 0 deletions examples/cc/core/BUILD.pants
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cc_binary(
name="tests",
dependencies=["./src:sources", "./tests:tests"]
)
2 changes: 2 additions & 0 deletions examples/cc/core/include/core/greeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ extern "C" {

void greet(void);

int add(int a, int b);

#ifdef __cplusplus
}
#endif //__cplusplus
Expand Down
4 changes: 3 additions & 1 deletion examples/cc/core/src/BUILD.pants
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
cc_sources()
cc_sources(
name="sources"
)
5 changes: 5 additions & 0 deletions examples/cc/core/src/greeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ void greet(void)
printf("Greetings, world%c", symbol);
}

int add(int a, int b)
{
return a + b;
}

// Declared in greeter-private.h
char greetingSymbol(void)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/cc/core/tests/BUILD.pants
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cc_sources(
name="tests"
)
Loading

0 comments on commit f5b14a3

Please sign in to comment.