Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Kolan Sh | 50f10130e9 |
|
@ -1,6 +1,6 @@
|
|||
[submodule "cmake"]
|
||||
path = cmake/backbone
|
||||
url = https://git.backbone.ws/kolan/cmake.backbone.git
|
||||
url = git@git.backbone.ws:cmake/backbone.git
|
||||
[submodule "util/backbone"]
|
||||
path = util/backbone
|
||||
url = https://git.backbone.ws/kolan/cmake.backbone-utils.git
|
||||
url = git@git.backbone.ws:cmake/backbone-utils.git
|
||||
|
|
|
@ -7,7 +7,7 @@ SET (PROJECT_DESCRIPTION "Host/Plugin Interfaces for GObject Based Applications/
|
|||
|
||||
SET (MAJOR 0)
|
||||
SET (MINOR 1)
|
||||
SET (PATCH 13)
|
||||
SET (PATCH 3)
|
||||
|
||||
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/backbone)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 206751e1f4814716d716f6bc297c280d4bf1dcf7
|
||||
Subproject commit e152fb65a854db14fcabd3b4f7735307fd403a68
|
|
@ -2,9 +2,9 @@ SET (CONTACT "backbone@backbone.ws")
|
|||
SET (DEBIAN_DEPENDENCIES "valac (>= 0.24), libglib2.0-bin (>= 2.33)")
|
||||
SET (DEBIAN_SECTION "Libraries")
|
||||
SET (REDHAT_DEPENDENCIES "vala >= 0.24, glib >= 2.33")
|
||||
SET (REDHAT_SECTION "Development/Libraries")
|
||||
SET (REDHAT_SECTION "Applications/Text")
|
||||
SET (LICENSE "LGPLv3+")
|
||||
SET (WIN32_UNINSTALL_NAME "GobjPlug") # <= 8 symbols for the name
|
||||
SET (CPACK_NSIS_MENU_LINKS "https://redmine.backbone.ws/projects/plugin"
|
||||
"Homepage for GObject/Plugin")
|
||||
INCLUDE (CPackCommonRules)
|
||||
|
||||
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
INCLUDE (CPackCommon)
|
||||
|
|
|
@ -1,15 +1,24 @@
|
|||
INCLUDE (PkgConfigCommonRules)
|
||||
|
||||
SET (PkgConfigLibs "-L\${libdir}")
|
||||
# configure pkg-config file
|
||||
IF (WIN32)
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}")
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-loader-${MAJOR}")
|
||||
ELSE (WIN32)
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-iface.so.${MAJOR}")
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-loader.so.${MAJOR}")
|
||||
ENDIF (WIN32)
|
||||
SET (PkgConfigPrefix "")
|
||||
ELSE ()
|
||||
SET (PkgConfigPrefix ${CMAKE_INSTALL_PREFIX})
|
||||
ENDIF ()
|
||||
SET (PkgConfigExecPrefix "\${prefix}")
|
||||
SET (PkgConfigLibDir "\${exec_prefix}/lib")
|
||||
SET (PkgConfigIncludeDir "\${prefix}/include")
|
||||
|
||||
SET (PkgConfigName "${CMAKE_PROJECT_NAME}")
|
||||
SET (PkgConfigDescription "${PROJECT_DESCRIPTION}")
|
||||
SET (PkgConfigVersion "${MAJOR}.${MINOR}.${PATCH}")
|
||||
SET (PkgConfigLibs "-L\${libdir}")
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}")
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}")
|
||||
SET (PkgConfigLibs "${PkgConfigLibs} -l${PROJECT_LOWERCASE_NAME}-loader-${MAJOR}")
|
||||
SET (PkgConfigLibsPrivate "")
|
||||
SET (PkgConfigCflags "")
|
||||
|
||||
CONFIGURE_FILE (
|
||||
"${CMAKE_SOURCE_DIR}/cmake/backbone/templates/pkg-config.pc.in"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pkg-config.pc.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOWERCASE_NAME}-${MAJOR}.pc"
|
||||
)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
prefix=@PkgConfigPrefix@
|
||||
exec_prefix=@PkgConfigExecPrefix@
|
||||
libdir=@PkgConfigLibDir@
|
||||
includedir=@PkgConfigIncludeDir@
|
||||
|
||||
Name: @PkgConfigName@
|
||||
Description: @PkgConfigDescription@
|
||||
Version: @PkgConfigVersion@
|
||||
Libs: @PkgConfigLibs@
|
||||
Libs.private: @PkgConfigLibsPrivate@
|
||||
Cflags: @PkgConfigCflags@
|
|
@ -1 +1,41 @@
|
|||
INCLUDE (GettextCommonRules)
|
||||
SET (GETTEXT_PACKAGE "${PROJECT_LOWERCASE_NAME_ABI}")
|
||||
ADD_DEFINITIONS (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}")
|
||||
|
||||
IF (WIN32)
|
||||
SET (LOCALEDIR "")
|
||||
ELSE ()
|
||||
SET (LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
|
||||
ENDIF ()
|
||||
|
||||
SET (CUSTOM_LOCALEDIR "" CACHE STRING "Directory to install l10n files into")
|
||||
|
||||
IF (NOT CUSTOM_LOCALEDIR STREQUAL "")
|
||||
SET (LOCALEDIR "${CUSTOM_LOCALEDIR}")
|
||||
MESSAGE(STATUS "Using LOCALEDIR=${LOCALEDIR}")
|
||||
ENDIF ()
|
||||
|
||||
ADD_DEFINITIONS (-DLOCALEDIR="${LOCALEDIR}")
|
||||
SET (LOCALE_INSTALL_DIR "share/locale")
|
||||
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
INCLUDE (MacroOptionalAddSubdirectory)
|
||||
FIND_PACKAGE (Gettext REQUIRED)
|
||||
|
||||
MACRO_OPTIONAL_ADD_SUBDIRECTORY (langs)
|
||||
|
||||
# configure a header file for Gettext
|
||||
SET (VERSION ${MAJOR}.${MINOR}.${PATCH})
|
||||
SET (PROJECT_LOWERCASE_NAME_ABI "${PROJECT_LOWERCASE_NAME}-${MAJOR}")
|
||||
|
||||
STRING (TOUPPER "${CMAKE_PROJECT_NAME}" GettextUniqueHeader)
|
||||
SET (GettextPackageNameAbi "${PROJECT_LOWERCASE_NAME_ABI}")
|
||||
CONFIGURE_FILE (
|
||||
"gettext-config.h.in"
|
||||
"${PROJECT_BINARY_DIR}/po/gettext-config.h"
|
||||
)
|
||||
|
||||
IF (NOT GETTEXT_MSGMERGE_EXECUTABLE)
|
||||
MESSAGE (FATAL_ERROR "Please install msgmerge binary")
|
||||
ENDIF (NOT GETTEXT_MSGMERGE_EXECUTABLE)
|
||||
IF (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR "Please install msgmerge binary")
|
||||
ENDIF (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef @GettextUniqueHeader@_H
|
||||
#define @GettextUniqueHeader@_H
|
||||
|
||||
#define GETTEXT_PACKAGE "@GettextPackageNameAbi@"
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define _(String) dgettext (GETTEXT_PACKAGE, String)
|
||||
#endif
|
||||
|
||||
#endif // @GettextUniqueHeader@_H
|
|
@ -0,0 +1,2 @@
|
|||
ADD_SUBDIRECTORY (ru)
|
||||
# ADD_SUBDIRECTORY (de)
|
|
@ -0,0 +1,2 @@
|
|||
FILE (GLOB _po_files *.po)
|
||||
GETTEXT_PROCESS_PO_FILES (ru ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} PO_FILES ${_po_files} )
|
|
@ -1 +0,0 @@
|
|||
INCLUDE (GettextLangRules)
|
|
@ -1,2 +1,5 @@
|
|||
ADD_SUBDIRECTORY (iface)
|
||||
INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/po)
|
||||
|
||||
ADD_SUBDIRECTORY (host-iface)
|
||||
ADD_SUBDIRECTORY (plugin-iface)
|
||||
ADD_SUBDIRECTORY (loader)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
SET (LibName ${PROJECT_LOWERCASE_NAME}-host-iface)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} HostInterface.vala)
|
||||
SET (LibPkgModules gee-0.8 gio-2.0)
|
||||
SET (LibExtraSources ${PROJECT_SOURCE_DIR}/src/library_constructor.c)
|
||||
SET (LibInstall ON)
|
||||
INCLUDE (ValaLibCommonRules)
|
|
@ -1,8 +0,0 @@
|
|||
SET (LibName ${PROJECT_LOWERCASE_NAME}-iface)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala)
|
||||
SET (LibPkgModules gee-0.8 gio-2.0)
|
||||
SET (LibInstall ON)
|
||||
SET (LibExtraSources ${CMAKE_CURRENT_BINARY_DIR}/library_constructor.c)
|
||||
SET (LC_RELATIVE_PREFIX "..")
|
||||
CONFIGURE_FILE ( "${CMAKE_SOURCE_DIR}/cmake/backbone/templates/library_constructor.c.in" "${LibExtraSources}")
|
||||
INCLUDE (ValaLibCommonRules)
|
|
@ -0,0 +1,35 @@
|
|||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "gettext-config.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
#elif defined(linux) || defined(UNIX) || defined(__unix__)
|
||||
void __attribute__ ((constructor)) load_library (void)
|
||||
#endif
|
||||
{
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
gchar dllPath[FILENAME_MAX],
|
||||
*dllDir,
|
||||
*localePath;
|
||||
|
||||
GetModuleFileName (hInstance, dllPath, FILENAME_MAX);
|
||||
dllDir = g_path_get_dirname (dllPath);
|
||||
localePath = g_build_filename (dllDir, "../share/locale", NULL);
|
||||
g_free (dllDir);
|
||||
bindtextdomain (GETTEXT_PACKAGE, localePath);
|
||||
g_free (localePath);
|
||||
#endif
|
||||
|
||||
#if (!GLIB_CHECK_VERSION (2, 36, 0))
|
||||
g_type_init ();
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
(void) dwReason; // avoid
|
||||
(void) lpReserved; // warngings
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
|
@ -1,16 +1,13 @@
|
|||
SET (LibName ${PROJECT_LOWERCASE_NAME}-loader)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} PluginLoader.vala)
|
||||
SET (LibPackages posix gee-0.8 gmodule-2.0 gio-2.0)
|
||||
SET (LibCustomVapis ${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi)
|
||||
SET (LibPackages gee-0.8 gmodule-2.0 gio-2.0)
|
||||
SET (LibCustomVapis ${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (LibExtraSources ${PROJECT_SOURCE_DIR}/src/library_constructor.c)
|
||||
SET (LibInstall ON)
|
||||
SET (LibExtraSources ${CMAKE_CURRENT_BINARY_DIR}/library_constructor.c)
|
||||
SET (LC_RELATIVE_PREFIX "..")
|
||||
CONFIGURE_FILE ( "${CMAKE_SOURCE_DIR}/cmake/backbone/templates/library_constructor.c.in" "${LibExtraSources}")
|
||||
SET (LibLinkLibs ${PROJECT_LOWERCASE_NAME}-iface gmodule-2.0)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/iface")
|
||||
IF (WIN32)
|
||||
SET (LibValaOpts -D WINDOWS)
|
||||
ELSE (WIN32)
|
||||
SET (LibValaOpts -D UNIX)
|
||||
ENDIF (WIN32)
|
||||
SET (LibLinkLibs ${PROJECT_LOWERCASE_NAME}-iface ${PROJECT_LOWERCASE_NAME}-host-iface gmodule-2.0)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaLibCommonRules)
|
||||
|
|
|
@ -34,15 +34,15 @@ namespace GObject {
|
|||
* Loads the module.
|
||||
*/
|
||||
public override bool load () {
|
||||
module = GLib.Module.open (path, GLib.ModuleFlags.LAZY);
|
||||
module = GLib.Module.open (path, GLib.ModuleFlags.BIND_LAZY);
|
||||
if (null == module) {
|
||||
stderr.printf("Cannot load module %s\n", path);
|
||||
message ("Module '%s' not found", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
void * plugin_init = null;
|
||||
if (! module.symbol ("plugin_init", out plugin_init)) {
|
||||
stderr.printf("No such symbol: plugin_init in %s\n", path);
|
||||
message ("No such symbol: plugin_init in module " + path);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -75,69 +75,6 @@ namespace GObject {
|
|||
}
|
||||
}
|
||||
|
||||
void sort_modules (Gee.ArrayList<Module> modules) {
|
||||
modules.sort ((a, b) => {
|
||||
var a_name = a.get_plugin_type ().name ();
|
||||
var b_name = b.get_plugin_type ().name ();
|
||||
if (a_name < b_name) return -1;
|
||||
if (a_name > b_name) return 1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads modules in the specific directory.
|
||||
*
|
||||
* @param dir_path path to the directory.
|
||||
* @param modules where to save list of modules.
|
||||
*
|
||||
* @return are the modules loaded correctly or not.
|
||||
*/
|
||||
public bool load_modules (string dir_path, ref Gee.ArrayList<Module>? modules) {
|
||||
|
||||
modules = new Gee.ArrayList<Module> ();
|
||||
#if (WINDOWS)
|
||||
var paths = new Gee.HashSet<string> ();
|
||||
#endif
|
||||
|
||||
try {
|
||||
var libPath = File.new_for_path (dir_path);
|
||||
#if (WINDOWS)
|
||||
for (var i = 0; i < 32; ++i) {
|
||||
var saved_length = modules.size;
|
||||
#endif
|
||||
var lib_enumerator = libPath.enumerate_children (FileAttribute.STANDARD_NAME, 0, null);
|
||||
FileInfo file_info = null;
|
||||
while ((file_info = lib_enumerator.next_file (null)) != null) {
|
||||
if (Regex.match_simple ("^.*\\.(so|dll)$", file_info.get_name ())) {
|
||||
var path = GLib.Module.build_path (dir_path, file_info.get_name ());
|
||||
#if (WINDOWS)
|
||||
if (paths.contains(path)) continue;
|
||||
#endif
|
||||
var module = new Module (path);
|
||||
if (module.load ()) {
|
||||
modules.add (module);
|
||||
#if (WINDOWS)
|
||||
paths.add(path);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (WINDOWS)
|
||||
if (modules.size == saved_length) break;
|
||||
}
|
||||
#endif
|
||||
} catch (Error e) {
|
||||
message (e.message);
|
||||
return false;
|
||||
}
|
||||
|
||||
sort_modules (modules);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads modules in the 2-depth directory tree path.
|
||||
*
|
||||
|
@ -146,55 +83,42 @@ namespace GObject {
|
|||
*
|
||||
* @return are the modules loaded correctly or not.
|
||||
*/
|
||||
public bool load_modules_depth2 (string dir_path, ref Gee.ArrayList<Module>? modules) {
|
||||
public bool load_modules (string dir_path, ref Gee.ArrayList<Module>? modules) {
|
||||
|
||||
modules = new Gee.ArrayList<Module> ();
|
||||
#if (WINDOWS)
|
||||
var paths = new Gee.HashSet<string> ();
|
||||
#endif
|
||||
|
||||
try {
|
||||
var libPath = File.new_for_path (dir_path);
|
||||
#if (WINDOWS)
|
||||
for (var i = 0; i < 32; ++i) {
|
||||
var saved_length = modules.size;
|
||||
#endif
|
||||
var dir_enumerator = libPath.enumerate_children ("standard::*",
|
||||
FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
|
||||
FileInfo dir_info = null;
|
||||
while ((dir_info = dir_enumerator.next_file (null)) != null ) {
|
||||
if (dir_info.get_file_type () == FileType.DIRECTORY) {
|
||||
File subdir = libPath.resolve_relative_path (dir_info.get_name ());
|
||||
var lib_enumerator = subdir.enumerate_children (FileAttribute.STANDARD_NAME, 0, null);
|
||||
FileInfo file_info = null;
|
||||
while ((file_info = lib_enumerator.next_file (null)) != null) {
|
||||
if (Regex.match_simple ("^.*\\.(so|dll)$", file_info.get_name ())) {
|
||||
var path = Path.build_path (Path.DIR_SEPARATOR_S, dir_path, dir_info.get_name ());
|
||||
path = GLib.Module.build_path (path, file_info.get_name ());
|
||||
#if (WINDOWS)
|
||||
if (paths.contains(path)) continue;
|
||||
#endif
|
||||
var module = new Module (path);
|
||||
if (module.load ()) {
|
||||
modules.add (module);
|
||||
#if (WINDOWS)
|
||||
paths.add(path);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
var dir_enumerator = libPath.enumerate_children ("standard::*",
|
||||
FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
|
||||
FileInfo dir_info = null;
|
||||
while ((dir_info = dir_enumerator.next_file (null)) != null ) {
|
||||
if (dir_info.get_file_type () == FileType.DIRECTORY) {
|
||||
File subdir = libPath.resolve_relative_path (dir_info.get_name ());
|
||||
var lib_enumerator = subdir.enumerate_children (FileAttribute.STANDARD_NAME, 0, null);
|
||||
FileInfo file_info = null;
|
||||
while ((file_info = lib_enumerator.next_file (null)) != null) {
|
||||
if (Regex.match_simple ("^.*\\.(so|dll)$", file_info.get_name ())) {
|
||||
var path = Path.build_path (Path.DIR_SEPARATOR_S, dir_path, dir_info.get_name ());
|
||||
var module = new Module (GLib.Module.build_path (path, file_info.get_name ()));
|
||||
if (module.load ())
|
||||
modules.add (module);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (WINDOWS)
|
||||
if (modules.size == saved_length) break;
|
||||
}
|
||||
#endif
|
||||
} catch (Error e) {
|
||||
message (e.message);
|
||||
return false;
|
||||
}
|
||||
|
||||
sort_modules (modules);
|
||||
modules.sort ((a, b) => {
|
||||
var a_name = a.get_plugin_type ().name ();
|
||||
var b_name = b.get_plugin_type ().name ();
|
||||
if (a_name < b_name) return -1;
|
||||
if (a_name > b_name) return 1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
SET (LibName ${PROJECT_LOWERCASE_NAME}-iface)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} PluginInterface.vala)
|
||||
SET (LibCustomVapis ${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi)
|
||||
SET (LibExtraSources ${PROJECT_SOURCE_DIR}/src/library_constructor.c)
|
||||
SET (LibInstall ON)
|
||||
SET (LibLinkLibs ${PROJECT_LOWERCASE_NAME}-host-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/host-iface")
|
||||
INCLUDE (ValaLibCommonRules)
|
|
@ -22,7 +22,7 @@ namespace GObject {
|
|||
/**
|
||||
* Host Interface.
|
||||
*/
|
||||
public unowned IHost host { get; set; default = null; }
|
||||
public IHost host { get; set; default = null; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,10 @@
|
|||
SET (LibName loader_test-iface)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} LoaderTestInterface.vala)
|
||||
SET (LibCustomVapis ${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi)
|
||||
SET (LibCustomVapis ${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (LibLinkLibs gobject-plugin-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/iface")
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaLibCommonRules)
|
||||
|
|
|
@ -2,16 +2,19 @@ SET (BinName loader_test)
|
|||
FILE (GLOB_RECURSE BinSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} LoaderTest.vala)
|
||||
SET (BinPackages gee-0.8 gio-2.0)
|
||||
SET (BinCustomVapis ${CMAKE_BINARY_DIR}/src/loader/${PROJECT_LOWERCASE_NAME}-loader-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/test/loader_test-iface/loader_test-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (BinLinkLibs ${PROJECT_LOWERCASE_NAME}-loader
|
||||
${PROJECT_LOWERCASE_NAME}-iface
|
||||
${PROJECT_LOWERCASE_NAME}-host-iface
|
||||
loader_test-iface
|
||||
)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/loader"
|
||||
"${CMAKE_BINARY_DIR}/src/iface"
|
||||
"${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/test/loader_test-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaBinCommonRules)
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@ int main (string [] args) {
|
|||
|
||||
var h = new LoaderTestHost ();
|
||||
|
||||
GObject.Plugins.load_modules_depth2 (
|
||||
GObject.Plugins.load_modules (
|
||||
Path.build_path (Path.DIR_SEPARATOR_S, File.new_for_path (
|
||||
args[0]).get_parent ().get_parent ().get_path (), "test/plugins/typeA"),
|
||||
ref type_a_modules
|
||||
);
|
||||
|
||||
GObject.Plugins.load_modules_depth2 (
|
||||
GObject.Plugins.load_modules (
|
||||
Path.build_path (Path.DIR_SEPARATOR_S, File.new_for_path (
|
||||
args[0]).get_parent ().get_parent ().get_path (), "test/plugins/typeB"),
|
||||
ref type_b_modules
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
SET (LibName type_a1)
|
||||
SET (LibIsPlugin ON)
|
||||
SET (LibNoApi ON)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeA1.vala)
|
||||
SET (LibCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
SET (PluginName type_a1)
|
||||
FILE (GLOB_RECURSE PluginSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeA1.vala)
|
||||
SET (PluginCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/test/loader_test-iface/loader_test-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (LibLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/iface"
|
||||
SET (PluginLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/test/loader_test-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaLibCommonRules)
|
||||
INCLUDE (ValaPluginCommonRules)
|
||||
|
||||
#INSTALL (TARGETS ${PluginName} DESTINATION lib/${PROJECT_LOWERCASE_NAME}-${MAJOR}/plugins/${PluginName})
|
||||
|
|
|
@ -25,12 +25,11 @@ public class TypeA1 : PluginTypeA {
|
|||
public override void method_a () {
|
||||
stdout.puts ("TypeA1.method_a () called\n");
|
||||
stdout.puts ("Call IHostLoaderTest.method_host () from TypeA1:\n ");
|
||||
var test = host as IHostLoaderTest;
|
||||
if (test != null) test.method_host ();
|
||||
(host as IHostLoaderTest).method_host ();
|
||||
}
|
||||
}
|
||||
|
||||
[ModuleInit]
|
||||
public Type plugin_init (GLib.TypeModule type_module) {
|
||||
Type plugin_init (GLib.TypeModule type_module) {
|
||||
return typeof (TypeA1);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
SET (LibName type_a2)
|
||||
SET (LibIsPlugin ON)
|
||||
SET (LibNoApi ON)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeA2.vala)
|
||||
SET (LibCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
SET (PluginName type_a2)
|
||||
FILE (GLOB_RECURSE PluginSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeA2.vala)
|
||||
SET (PluginCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/test/loader_test-iface/loader_test-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (LibLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/iface"
|
||||
SET (PluginLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/test/loader_test-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaLibCommonRules)
|
||||
INCLUDE (ValaPluginCommonRules)
|
||||
|
||||
#INSTALL (TARGETS ${PluginName} DESTINATION lib/${PROJECT_LOWERCASE_NAME}-${MAJOR}/plugins/${PluginName})
|
||||
|
|
|
@ -28,6 +28,6 @@ public class TypeA2 : PluginTypeA {
|
|||
}
|
||||
|
||||
[ModuleInit]
|
||||
public Type plugin_init (GLib.TypeModule type_module) {
|
||||
Type plugin_init (GLib.TypeModule type_module) {
|
||||
return typeof (TypeA2);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
SET (LibName type_b1)
|
||||
SET (LibIsPlugin ON)
|
||||
SET (LibNoApi ON)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeB1.vala)
|
||||
SET (LibCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
SET (PluginName type_b1)
|
||||
FILE (GLOB_RECURSE PluginSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeB1.vala)
|
||||
SET (PluginCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/test/loader_test-iface/loader_test-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (LibLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/iface"
|
||||
SET (PluginLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/test/loader_test-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaLibCommonRules)
|
||||
INCLUDE (ValaPluginCommonRules)
|
||||
|
||||
#INSTALL (TARGETS ${PluginName} DESTINATION lib/${PROJECT_LOWERCASE_NAME}-${MAJOR}/plugins/${PluginName})
|
||||
|
|
|
@ -29,6 +29,6 @@ public class TypeB1 : PluginTypeB {
|
|||
}
|
||||
|
||||
[ModuleInit]
|
||||
public Type plugin_init (GLib.TypeModule type_module) {
|
||||
Type plugin_init (GLib.TypeModule type_module) {
|
||||
return typeof (TypeB1);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
SET (LibName type_b2)
|
||||
SET (LibIsPlugin ON)
|
||||
SET (LibNoApi ON)
|
||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeB2.vala)
|
||||
SET (LibCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
SET (PluginName type_b2)
|
||||
FILE (GLOB_RECURSE PluginSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} TypeB2.vala)
|
||||
SET (PluginCustomVapis
|
||||
${CMAKE_BINARY_DIR}/src/plugin-iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/test/loader_test-iface/loader_test-iface-${MAJOR}.vapi
|
||||
${CMAKE_BINARY_DIR}/src/host-iface/${PROJECT_LOWERCASE_NAME}-host-iface-${MAJOR}.vapi
|
||||
)
|
||||
SET (LibLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/iface"
|
||||
SET (PluginLinkLibs gobject-plugin-iface loader_test-iface)
|
||||
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/plugin-iface"
|
||||
"${CMAKE_BINARY_DIR}/test/loader_test-iface"
|
||||
"${CMAKE_BINARY_DIR}/src/host-iface"
|
||||
)
|
||||
INCLUDE (ValaLibCommonRules)
|
||||
INCLUDE (ValaPluginCommonRules)
|
||||
|
||||
#INSTALL (TARGETS ${PluginName} DESTINATION lib/${PROJECT_LOWERCASE_NAME}-${MAJOR}/plugins/${PluginName})
|
||||
|
|
|
@ -29,6 +29,6 @@ public class TypeB2 : PluginTypeB {
|
|||
}
|
||||
|
||||
[ModuleInit]
|
||||
public Type plugin_init (GLib.TypeModule type_module) {
|
||||
Type plugin_init (GLib.TypeModule type_module) {
|
||||
return typeof (TypeB2);
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 11c998aca2aa1b787286b336e579e5a4e31f471a
|
||||
Subproject commit aa78f6d42c85f7f9a98a1a6273230a9775824fc7
|
Loading…
Reference in New Issue