From 9836a9d43d0d0151715697865ac520d789893d05 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Dec 2017 14:13:31 +0100 Subject: Compile check C++ API --- lilv/lilvmm.hpp | 1 + test/lilv_cxx_test.cpp | 23 +++++++++++++++++++++++ wscript | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 test/lilv_cxx_test.cpp diff --git a/lilv/lilvmm.hpp b/lilv/lilvmm.hpp index b9b3a69..30ec274 100644 --- a/lilv/lilvmm.hpp +++ b/lilv/lilvmm.hpp @@ -27,6 +27,7 @@ namespace Lilv { +LILV_DEPRECATED static inline const char* uri_to_path(const char* uri) { return lilv_uri_to_path(uri); diff --git a/test/lilv_cxx_test.cpp b/test/lilv_cxx_test.cpp new file mode 100644 index 0000000..25f30bf --- /dev/null +++ b/test/lilv_cxx_test.cpp @@ -0,0 +1,23 @@ +/* + Copyright 2017 David Robillard + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "lilv/lilvmm.hpp" + +int +main() +{ + return 0; +} diff --git a/wscript b/wscript index d4f8de8..966b497 100644 --- a/wscript +++ b/wscript @@ -62,6 +62,10 @@ def options(ctx): def configure(conf): conf.load('compiler_c') + try: + conf.load('compiler_cxx') + except: + pass if Options.options.bindings: try: @@ -357,6 +361,19 @@ def build(bld): linkflags = test_linkflags) autowaf.use_lib(bld, obj, 'SERD SORD SRATOM LV2') + # C++ API test + if 'COMPILER_CXX' in bld.env: + obj = bld(features = 'cxx cxxprogram', + source = 'test/lilv_cxx_test.cpp', + includes = ['.', './src'], + use = 'liblilv_profiled', + lib = test_libs, + target = 'test/lilv_cxx_test', + install_path = None, + cxxflags = test_cflags, + linkflags = test_linkflags) + autowaf.use_lib(bld, obj, 'SERD SORD SRATOM LV2') + if bld.is_defined('LILV_PYTHON'): # Copy Python unittest files for i in [ 'test_api.py' ]: -- cgit v1.2.1