Skip to content

Commit

Permalink
Added example project
Browse files Browse the repository at this point in the history
  • Loading branch information
LeFrosch committed Mar 28, 2024
1 parent 90d5326 commit 00ebcdd
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/cpp/external_includes/external/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cc_library(
name = "simple",
srcs = ["simple.cc"],
hdrs = ["simple.h"],
visibility = ["//visibility:public"],
)
Empty file.
7 changes: 7 additions & 0 deletions examples/cpp/external_includes/external/simple.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "simple.h"

#include <stdio.h>

void simple_header_fun() {
printf("Hello there!\n");
}
6 changes: 6 additions & 0 deletions examples/cpp/external_includes/external/simple.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef SIMPLE_H
#define SIMPLE_H

void simple_header_fun();

#endif
1 change: 1 addition & 0 deletions examples/cpp/external_includes/project/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --features=external_include_paths
5 changes: 5 additions & 0 deletions examples/cpp/external_includes/project/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cc_binary(
name = "simple",
srcs = ["simple.cc"],
deps = ["@lib//:simple"],
)
4 changes: 4 additions & 0 deletions examples/cpp/external_includes/project/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
local_repository(
name = "lib",
path = "../external",
)
6 changes: 6 additions & 0 deletions examples/cpp/external_includes/project/simple.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <simple.h>

int main() {
simple_header_fun();
return 0;
}

0 comments on commit 00ebcdd

Please sign in to comment.