From 8ad4779a054a4d82c8d3d32978b3f7609b739cb4 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 1 Jul 2016 14:43:51 +0530 Subject: [PATCH] Add test for installation of libraries in subprojects The original test's subproject-install check had to be removed because library names are now properly platform-specific --- .../installed_files.txt | 3 +++ .../8 subproject library install/meson.build | 6 ++++++ .../subprojects/sublib/include/subdefs.h | 21 +++++++++++++++++++ .../subprojects/sublib/meson.build | 10 +++++++++ .../subprojects/sublib/sublib.c | 5 +++++ 5 files changed, 45 insertions(+) create mode 100644 test cases/linuxlike/8 subproject library install/installed_files.txt create mode 100644 test cases/linuxlike/8 subproject library install/meson.build create mode 100644 test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h create mode 100644 test cases/linuxlike/8 subproject library install/subprojects/sublib/meson.build create mode 100644 test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c diff --git a/test cases/linuxlike/8 subproject library install/installed_files.txt b/test cases/linuxlike/8 subproject library install/installed_files.txt new file mode 100644 index 000000000..5c4a3018e --- /dev/null +++ b/test cases/linuxlike/8 subproject library install/installed_files.txt @@ -0,0 +1,3 @@ +usr/lib/libsublib.so +usr/lib/libsublib.so.5 +usr/lib/libsublib.so.2.1.0 diff --git a/test cases/linuxlike/8 subproject library install/meson.build b/test cases/linuxlike/8 subproject library install/meson.build new file mode 100644 index 000000000..63e57cfd7 --- /dev/null +++ b/test cases/linuxlike/8 subproject library install/meson.build @@ -0,0 +1,6 @@ +project('subproj lib install', 'c', + version : '2.3.4', + license : 'mylicense') + +# Test that the subproject library gets installed +subproject('sublib', version : '1.0.0') diff --git a/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h b/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h new file mode 100644 index 000000000..681c7b890 --- /dev/null +++ b/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h @@ -0,0 +1,21 @@ +#ifndef SUBDEFS_H_ +#define SUBDEFS_H_ + +#if defined _WIN32 || defined __CYGWIN__ +#if defined BUILDING_SUB + #define DLL_PUBLIC __declspec(dllexport) +#else + #define DLL_PUBLIC __declspec(dllimport) +#endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC subfunc(); + +#endif diff --git a/test cases/linuxlike/8 subproject library install/subprojects/sublib/meson.build b/test cases/linuxlike/8 subproject library install/subprojects/sublib/meson.build new file mode 100644 index 000000000..97658fa5e --- /dev/null +++ b/test cases/linuxlike/8 subproject library install/subprojects/sublib/meson.build @@ -0,0 +1,10 @@ +project('subproject', 'c', + version : '1.0.0', + license : ['sublicense1', 'sublicense2']) + +i = include_directories('include') +shared_library('sublib', 'sublib.c', + version : '2.1.0', + soversion : 5, + include_directories : i, install : true, + c_args : '-DBUILDING_SUB=2') diff --git a/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c b/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c new file mode 100644 index 000000000..c13326b85 --- /dev/null +++ b/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c @@ -0,0 +1,5 @@ +#include + +int DLL_PUBLIC subfunc() { + return 42; +}