summaryrefslogtreecommitdiff
path: root/test cases/frameworks/1 boost/extralib.cpp
diff options
context:
space:
mode:
authorMichał Wikliński <mail@sirmike.org>2017-08-19 03:13:29 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-08-20 23:17:12 +0300
commit9154a6473b28f4cb60d23a7bc15ab8b1d223c1bb (patch)
tree0464fbf4f0a16dd104ca69fb7693a8244aa3abe8 /test cases/frameworks/1 boost/extralib.cpp
parent24ff7da0d2a5dabbe17f5e9c648ef1ef6e2232aa (diff)
downloadmeson-9154a6473b28f4cb60d23a7bc15ab8b1d223c1bb.tar.gz
Find Boost dep when there is an extra lib to link
There are several components in Boost which must be linked with extra libraries. Boost Log is one of them and in special circumstances needs linking with boost_log_setup. http://www.boost.org/doc/libs/1_64_0/libs/log/doc/html/log/detailed/utilities.html#log.detailed.utilities.setup This fix covers the case when there is no source file corresponding to the additional library.
Diffstat (limited to 'test cases/frameworks/1 boost/extralib.cpp')
-rw-r--r--test cases/frameworks/1 boost/extralib.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test cases/frameworks/1 boost/extralib.cpp b/test cases/frameworks/1 boost/extralib.cpp
new file mode 100644
index 000000000..6a3e9e4d1
--- /dev/null
+++ b/test cases/frameworks/1 boost/extralib.cpp
@@ -0,0 +1,25 @@
+#include <iostream>
+#include <boost/log/trivial.hpp>
+#include <boost/log/expressions.hpp>
+#include <boost/log/utility/setup/console.hpp>
+#include <boost/log/utility/setup/common_attributes.hpp>
+
+using namespace std;
+namespace logging = boost::log;
+
+void InitLogger() {
+ logging::add_common_attributes();
+ logging::register_simple_formatter_factory<logging::trivial::severity_level, char>("Severity");
+ string log_format = "%TimeStamp% [%Severity%] - %Message%";
+
+ logging::add_console_log(
+ cout,
+ logging::keywords::format = log_format
+ );
+}
+
+int main(int argc, char **argv) {
+ InitLogger();
+ BOOST_LOG_TRIVIAL(trace) << "SOMETHING";
+ return 0;
+}