Library constructor and cmake/backbone submodule updated.

This commit is contained in:
Kolan Sh 2015-11-14 03:06:26 +03:00
parent dff4194add
commit 16464aa662
3 changed files with 4 additions and 37 deletions

@ -1 +1 @@
Subproject commit a0b668336067535dbb84e7e7d01b9730af429541
Subproject commit 02f3a0f7d969534872799b45a95d3c5a6fef14c3

View File

@ -2,6 +2,8 @@ SET (LibName ${PROJECT_LOWERCASE_NAME})
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala)
SET (LibPackages gee-0.8 posix)
SET (LibPkgModules gee-0.8)
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}")
INCLUDE (ValaLibCommonRules)

View File

@ -1,35 +0,0 @@
#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; // warnings
return TRUE;
#endif
}