Browse Source

Library constructor and cmake/backbone submodule updated.

develop
Kolan Sh 6 years ago
parent
commit
16464aa662
  1. 2
      cmake/backbone
  2. 4
      src/latex-struct/CMakeLists.txt
  3. 35
      src/library_constructor.c

2
cmake/backbone

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

4
src/latex-struct/CMakeLists.txt

@ -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)

35
src/library_constructor.c

@ -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
}
Loading…
Cancel
Save