diff options
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 | 29 | ||||
-rw-r--r-- | libhello/libhello/buildfile | 26 | ||||
-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 | 18 | ||||
-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, 125 insertions, 23 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 e65edde..b3ad7e3 100644 --- a/libhello/buildfile +++ b/libhello/buildfile @@ -1,26 +1,9 @@ -import int_libs = libformat%lib{format} -import imp_libs = libprint%lib{print} +./: libhello/ tests/ doc{INSTALL version} file{manifest} -lib{hello}: {hxx cxx}{hello} hxx{export} $imp_libs $int_libs +doc{version}: file{manifest} # Generated by the version module. +doc{version}: dist = true -# For pre-releases use the complete version to make sure they cannot be used -# in place of another pre-release or the final version. +# Don't install tests or the INSTALL file. # -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 - -lib{hello}: cxx.export.libs = $int_libs - -# Install into the libhello/ subdirectory of, say, /usr/include/. -# -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..e65edde --- /dev/null +++ b/libhello/libhello/buildfile @@ -0,0 +1,26 @@ +import int_libs = libformat%lib{format} +import imp_libs = libprint%lib{print} + +lib{hello}: {hxx cxx}{hello} hxx{export} $imp_libs $int_libs + +# 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 + +lib{hello}: cxx.export.libs = $int_libs + +# 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 f7e3b7f..f7e3b7f 100644 --- a/libhello/hello.cxx +++ b/libhello/libhello/hello.cxx diff --git a/libhello/hello.hxx b/libhello/libhello/hello.hxx index ccc43c2..ccc43c2 100644 --- a/libhello/hello.hxx +++ b/libhello/libhello/hello.hxx diff --git a/libhello/manifest b/libhello/manifest new file mode 100644 index 0000000..fee9ce7 --- /dev/null +++ b/libhello/manifest @@ -0,0 +1,18 @@ +: 1 +name: libhello +version: 1.1.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- +depends: libformat [1.0.0 2.0.0-); compatible with libformat-1.X.Y +depends: libprint [1.0.0 2.0.0-); compatible with libprint-1.X.Y 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! |