srctree

Johan parent bcfe9ecd 9976ba38 46f08a9f
Merge pull request #227 from robinlinden/add-bazel

Set up a Bazel build
filename was Deleted added: 104, removed: 8, total 96
@@ -0,0 +1 @@
build/
 
filename was Deleted added: 104, removed: 8, total 96
@@ -0,0 +1,6 @@
build --color=yes
test --test_output=errors
test --test_verbose_timeout_warnings=true
 
build:gnulike --cxxopt="-std=c++17"
build:msvc --cxxopt="/std:c++17"
 
.gitignore added: 104, removed: 8, total 96
@@ -1,4 +1,5 @@
_build/
bazel-*/
build/
cmake-build-*/
.idea/
 
.travis.yml added: 104, removed: 8, total 96
@@ -8,6 +8,29 @@ addons:
 
matrix:
include:
- name: "bazel"
before_install:
- OS=linux
- ARCH=x86_64
- V=2.1.1
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then OS=darwin; fi
- GH_BASE="https://github.com/bazelbuild/bazel/releases/download/$V"
- GH_ARTIFACT="bazel-$V-installer-$OS-$ARCH.sh"
- URL="$GH_BASE/$GH_ARTIFACT"
- wget -O install.sh $URL
- chmod +x install.sh
- ./install.sh --user
- rm -f install.sh
install: []
before_script: []
script:
- |
bazel \
--output_base=$HOME/.cache/bazel \
test \
--config=gnulike \
...
 
- name: "clang-tidy 9"
addons:
apt:
 
filename was Deleted added: 104, removed: 8, total 96
@@ -0,0 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
 
git_repository(
name = "gtest",
commit = "703bd9caab50b139428cea1aaff9974ebee5742e",
remote = "https://github.com/google/googletest",
shallow_since = "1570114335 -0400",
)
 
filename was Deleted added: 104, removed: 8, total 96
@@ -0,0 +1,8 @@
cc_binary(
name = "application",
srcs = ["src/main.cpp"],
deps = [
"//core",
"//nes",
],
)
 
filename was Deleted added: 104, removed: 8, total 96
@@ -0,0 +1,25 @@
cc_library(
name = "core",
srcs = glob([
"src/**",
]),
hdrs = glob([
"include/**/*.h",
]),
copts = ["-Icore/src"],
strip_include_prefix = "include/",
visibility = ["//visibility:public"],
)
 
cc_test(
name = "core_test",
size = "small",
srcs = glob([
"test/src/*.cpp",
"test/src/*.h",
]),
deps = [
":core",
"@gtest",
],
)
 
filename was Deleted added: 104, removed: 8, total 96
@@ -0,0 +1,24 @@
cc_library(
name = "nes",
srcs = glob([
"src/**",
]),
hdrs = glob([
"include/**/*.h",
]),
strip_include_prefix = "include/",
visibility = ["//visibility:public"],
deps = ["//core"],
)
 
cc_test(
name = "nes_test",
size = "small",
srcs = glob([
"test/src/*.cpp",
]),
deps = [
":nes",
"@gtest",
],
)