diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-06-19 18:39:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-06-19 18:39:08 +0300 |
commit | 58e44f2cdad782fd9c5cf177c2bb1ca8a86c0e15 (patch) | |
tree | 619306b9f37e404b04a391e71b31b4bab9ca5d61 /libhello | |
parent | b6eb2a7b37def077581f1eb968b5991e755eeda9 (diff) |
Move project into intermediate sub-directory
Diffstat (limited to 'libhello')
-rw-r--r-- | libhello/.gitignore | 16 | ||||
-rw-r--r-- | libhello/INSTALL | 1 | ||||
-rw-r--r-- | libhello/build/.gitignore | 1 | ||||
-rw-r--r-- | libhello/build/bootstrap.build | 7 | ||||
-rw-r--r-- | libhello/build/export.build | 6 | ||||
-rw-r--r-- | libhello/build/root.build | 6 | ||||
-rw-r--r-- | libhello/buildfile | 24 | ||||
-rw-r--r-- | libhello/libhello/buildfile | 21 | ||||
-rw-r--r-- | libhello/libhello/export.hxx (renamed from libhello/export.hxx) | 0 | ||||
-rw-r--r-- | libhello/libhello/hello.cxx (renamed from libhello/hello.cxx) | 0 | ||||
-rw-r--r-- | libhello/libhello/hello.hxx (renamed from libhello/hello.hxx) | 0 | ||||
-rw-r--r-- | libhello/manifest | 16 | ||||
-rw-r--r-- | libhello/tests/.gitignore | 1 | ||||
-rw-r--r-- | libhello/tests/build/.gitignore | 1 | ||||
-rw-r--r-- | libhello/tests/build/bootstrap.build | 5 | ||||
-rw-r--r-- | libhello/tests/build/root.build | 14 | ||||
-rw-r--r-- | libhello/tests/buildfile | 1 | ||||
-rw-r--r-- | libhello/tests/test/buildfile | 4 | ||||
-rw-r--r-- | libhello/tests/test/driver.cxx | 11 | ||||
-rw-r--r-- | libhello/tests/test/test.out | 1 |
20 files changed, 118 insertions, 18 deletions
diff --git a/libhello/.gitignore b/libhello/.gitignore new file mode 100644 index 0000000..a887fdd --- /dev/null +++ b/libhello/.gitignore @@ -0,0 +1,16 @@ +# Compiler/linker output. +# +*.d +*.ii +*.o +*.obj +*.so +*.dll +*.a +*.lib +*.exp +*.exe +*.exe.dlls/ +*.exe.manifest + +version diff --git a/libhello/INSTALL b/libhello/INSTALL new file mode 100644 index 0000000..485b10f --- /dev/null +++ b/libhello/INSTALL @@ -0,0 +1 @@ +Just use build2, bro. diff --git a/libhello/build/.gitignore b/libhello/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/libhello/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/libhello/build/bootstrap.build b/libhello/build/bootstrap.build new file mode 100644 index 0000000..1ff153d --- /dev/null +++ b/libhello/build/bootstrap.build @@ -0,0 +1,7 @@ +project = libhello + +using version +using config +using dist +using test +using install diff --git a/libhello/build/export.build b/libhello/build/export.build new file mode 100644 index 0000000..0151425 --- /dev/null +++ b/libhello/build/export.build @@ -0,0 +1,6 @@ +$out_root/: +{ + include libhello/ +} + +export $out_root/libhello/lib{hello} diff --git a/libhello/build/root.build b/libhello/build/root.build new file mode 100644 index 0000000..8ceadfa --- /dev/null +++ b/libhello/build/root.build @@ -0,0 +1,6 @@ +cxx.std = 11 + +using cxx + +hxx{*}: extension = hxx +cxx{*}: extension = cxx diff --git a/libhello/buildfile b/libhello/buildfile index 76d079f..b3ad7e3 100644 --- a/libhello/buildfile +++ b/libhello/buildfile @@ -1,21 +1,9 @@ -lib{hello}: {hxx cxx}{hello} hxx{export} +./: libhello/ tests/ doc{INSTALL version} file{manifest} -# For pre-releases use the complete version to make sure they cannot be used -# in place of another pre-release or the final version. -# -if $version.pre_release - lib{hello}: bin.lib.version = @"-$version.project_id" -else - lib{hello}: bin.lib.version = @"-$version.major.$version.minor" - -cxx.poptions =+ "-I$out_root" "-I$src_root" -obja{*}: cxx.poptions += -DLIBHELLO_STATIC_BUILD -objs{*}: cxx.poptions += -DLIBHELLO_SHARED_BUILD - -lib{hello}: cxx.export.poptions = "-I$out_root" "-I$src_root" -liba{hello}: cxx.export.poptions += -DLIBHELLO_STATIC -libs{hello}: cxx.export.poptions += -DLIBHELLO_SHARED +doc{version}: file{manifest} # Generated by the version module. +doc{version}: dist = true -# Install into the libhello/ subdirectory of, say, /usr/include/. +# Don't install tests or the INSTALL file. # -install.include = $install.include/libhello/ +dir{tests/}: install = false +doc{INSTALL}@./: install = false diff --git a/libhello/libhello/buildfile b/libhello/libhello/buildfile new file mode 100644 index 0000000..76d079f --- /dev/null +++ b/libhello/libhello/buildfile @@ -0,0 +1,21 @@ +lib{hello}: {hxx cxx}{hello} hxx{export} + +# For pre-releases use the complete version to make sure they cannot be used +# in place of another pre-release or the final version. +# +if $version.pre_release + lib{hello}: bin.lib.version = @"-$version.project_id" +else + lib{hello}: bin.lib.version = @"-$version.major.$version.minor" + +cxx.poptions =+ "-I$out_root" "-I$src_root" +obja{*}: cxx.poptions += -DLIBHELLO_STATIC_BUILD +objs{*}: cxx.poptions += -DLIBHELLO_SHARED_BUILD + +lib{hello}: cxx.export.poptions = "-I$out_root" "-I$src_root" +liba{hello}: cxx.export.poptions += -DLIBHELLO_STATIC +libs{hello}: cxx.export.poptions += -DLIBHELLO_SHARED + +# Install into the libhello/ subdirectory of, say, /usr/include/. +# +install.include = $install.include/libhello/ diff --git a/libhello/export.hxx b/libhello/libhello/export.hxx index e6c723e..e6c723e 100644 --- a/libhello/export.hxx +++ b/libhello/libhello/export.hxx diff --git a/libhello/hello.cxx b/libhello/libhello/hello.cxx index 677815d..677815d 100644 --- a/libhello/hello.cxx +++ b/libhello/libhello/hello.cxx diff --git a/libhello/hello.hxx b/libhello/libhello/hello.hxx index 58bd7b2..58bd7b2 100644 --- a/libhello/hello.hxx +++ b/libhello/libhello/hello.hxx diff --git a/libhello/manifest b/libhello/manifest new file mode 100644 index 0000000..3252b91 --- /dev/null +++ b/libhello/manifest @@ -0,0 +1,16 @@ +: 1 +name: libhello +version: 1.0.0 +summary: The "Hello World" example library +license: MIT +tags: c++, hello, world, example +description: \ +A simple library that implements the "Hello World" example in C++. Its primary +goal is to show a canonical build2/bpkg project/package. +\ +url: http://www.example.org/libhello +email: hello-users@example.org +build-email: builds@build2.org +requires: c++11 +depends: * build2 >= 0.5.0- +depends: * bpkg >= 0.5.0- diff --git a/libhello/tests/.gitignore b/libhello/tests/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/libhello/tests/.gitignore @@ -0,0 +1 @@ +driver diff --git a/libhello/tests/build/.gitignore b/libhello/tests/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/libhello/tests/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/libhello/tests/build/bootstrap.build b/libhello/tests/build/bootstrap.build new file mode 100644 index 0000000..2c2de24 --- /dev/null +++ b/libhello/tests/build/bootstrap.build @@ -0,0 +1,5 @@ +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/libhello/tests/build/root.build b/libhello/tests/build/root.build new file mode 100644 index 0000000..a2ee38a --- /dev/null +++ b/libhello/tests/build/root.build @@ -0,0 +1,14 @@ +cxx.std = 11 + +using cxx + +hxx{*}: extension = hxx +cxx{*}: extension = cxx + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/libhello/tests/buildfile b/libhello/tests/buildfile new file mode 100644 index 0000000..1a8bcc9 --- /dev/null +++ b/libhello/tests/buildfile @@ -0,0 +1 @@ +./: test/ diff --git a/libhello/tests/test/buildfile b/libhello/tests/test/buildfile new file mode 100644 index 0000000..a46969d --- /dev/null +++ b/libhello/tests/test/buildfile @@ -0,0 +1,4 @@ +import libs = libhello%lib{hello} + +exe{driver}: cxx{driver} $libs +exe{driver}: test.output = test.out diff --git a/libhello/tests/test/driver.cxx b/libhello/tests/test/driver.cxx new file mode 100644 index 0000000..38937f0 --- /dev/null +++ b/libhello/tests/test/driver.cxx @@ -0,0 +1,11 @@ +// file: tests/test/driver.cxx -*- C++ -*- + +#include <libhello/hello.hxx> + +int +main () +{ + using hello::say; + + say ("World"); +} diff --git a/libhello/tests/test/test.out b/libhello/tests/test/test.out new file mode 100644 index 0000000..8ab686e --- /dev/null +++ b/libhello/tests/test/test.out @@ -0,0 +1 @@ +Hello, World! |