mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
engine - remove gncmod boilerplate
engine is now an ordinary shared library This requires a few more places to run gnc_engine_init as this is no longer done as part of module loading.
This commit is contained in:
parent
95b81844ad
commit
4c77f7670e
@ -868,7 +868,7 @@ configure_file(
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
||||
set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils gnucash-guile)
|
||||
set(_MODULES gnc-core-utils gnc-engine gnc-module gnc-backend-xml-utils gnucash-guile)
|
||||
|
||||
if (WITH_SQL)
|
||||
list(APPEND _MODULES gnc-backend-sql)
|
||||
|
@ -10,7 +10,7 @@ gnc_add_swig_guile_command (swig-core-utils-guile-c
|
||||
)
|
||||
|
||||
# Command to generate the swig-engine.c wrapper file
|
||||
gnc_swig_extract_header_files (gncmod-engine ENGINE_HEADERS)
|
||||
gnc_swig_extract_header_files (gnc-engine ENGINE_HEADERS)
|
||||
gnc_add_swig_guile_command (swig-engine-c
|
||||
SWIG_ENGINE_C swig-engine.c
|
||||
${CMAKE_SOURCE_DIR}/bindings/engine.i
|
||||
@ -66,7 +66,7 @@ target_link_libraries(gnucash-guile
|
||||
${GUILE_LDFLAGS}
|
||||
PRIVATE
|
||||
gnc-core-utils
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnc-module
|
||||
${GLIB2_LDFLAGS})
|
||||
|
||||
@ -111,7 +111,7 @@ endif(WITH_SQL)
|
||||
|
||||
set(GUILE_DEPENDS
|
||||
${BACKEND_DEPENDS}
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnucash-guile)
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ set(ENGINE_TEST_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
set(ENGINE_TEST_LIBS
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gncmod-test-engine
|
||||
test-core
|
||||
gnucash-guile
|
||||
@ -80,7 +80,7 @@ if (HAVE_SRFI64)
|
||||
gnc_add_scheme_test_targets (scm-test-with-srfi64
|
||||
"${scm_tests_with_srfi64_SOURCES}"
|
||||
"tests"
|
||||
"${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras;gncmod-engine"
|
||||
"${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras;gnc-engine"
|
||||
FALSE
|
||||
)
|
||||
|
||||
|
@ -84,8 +84,7 @@ run_tests (void)
|
||||
static void
|
||||
main_helper (void *closure, int argc, char **argv)
|
||||
{
|
||||
gnc_module_system_init ();
|
||||
gnc_module_load("gnucash/engine", 0);
|
||||
gnc_engine_init (0, NULL);
|
||||
|
||||
xaccLogDisable ();
|
||||
|
||||
|
@ -76,7 +76,7 @@ if(WITH_PYTHON)
|
||||
add_library(gnucash_core_c MODULE ${SWIG_GNUCASH_CORE_C})
|
||||
target_include_directories(gnucash_core_c PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(gnucash_core_c gncmod-app-utils gncmod-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
target_link_libraries(gnucash_core_c gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
set_target_properties(gnucash_core_c PROPERTIES PREFIX "_")
|
||||
target_compile_options(gnucash_core_c PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
|
||||
if (HAVE_STRINGOP_TRUNCATION)
|
||||
@ -84,7 +84,7 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
|
||||
add_executable(sqlite3test EXCLUDE_FROM_ALL sqlite3test.c ${SWIG_GNUCASH_CORE_C})
|
||||
target_link_libraries(sqlite3test gncmod-app-utils gncmod-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
target_link_libraries(sqlite3test gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
target_include_directories(sqlite3test PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
|
||||
target_compile_options(sqlite3test PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
|
||||
if (HAVE_STRINGOP_TRUNCATION)
|
||||
|
@ -22,7 +22,7 @@ set_dist_list(test_core_DIST ${test_core_SOURCES} ${test_core_noinst_HEADERS} CM
|
||||
unittest-support.i unittest-support.scm)
|
||||
|
||||
add_library(test-core STATIC ${test_core_SOURCES} ${test_core_noinst_HEADERS})
|
||||
target_link_libraries(test-core gncmod-engine ${GLIB2_LDFLAGS})
|
||||
target_link_libraries(test-core gnc-engine ${GLIB2_LDFLAGS})
|
||||
if (UNIX)
|
||||
target_compile_options(test-core PRIVATE -fPIC)
|
||||
endif()
|
||||
|
@ -52,7 +52,7 @@ endif (BUILDING_FROM_VCS)
|
||||
|
||||
target_link_libraries (gnucash
|
||||
gncmod-ledger-core gnc-gnome gncmod-gnome-utils gncmod-app-utils
|
||||
gncmod-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
|
||||
gnc-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
|
||||
PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
|
||||
)
|
||||
|
||||
|
@ -60,12 +60,6 @@ libgncmod_gnome_search_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_gnome_search_gnc_module_init(int refcount)
|
||||
{
|
||||
/* load the engine (we depend on it) */
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -206,7 +206,7 @@ add_library (gncmod-gnome-utils
|
||||
|
||||
target_link_libraries(gncmod-gnome-utils
|
||||
gncmod-app-utils
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnc-backend-xml-utils
|
||||
gnucash-guile
|
||||
PkgConfig::GTK3
|
||||
|
@ -73,12 +73,6 @@ extern SCM scm_init_sw_gnome_utils_module(void);
|
||||
int
|
||||
libgncmod_gnome_utils_gnc_module_init(int refcount)
|
||||
{
|
||||
/* load the engine (we depend on it) */
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -33,7 +33,7 @@ set(GUILE_DEPENDS
|
||||
gncmod-test-engine
|
||||
gncmod-app-utils
|
||||
gnc-core-utils
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
)
|
||||
|
||||
gnc_add_scheme_test_targets(scm-test-load-gnome-utils-module
|
||||
|
@ -144,7 +144,7 @@ target_link_libraries(gnc-gnome
|
||||
gncmod-register-gnome
|
||||
gncmod-register-core
|
||||
gncmod-gnome-utils
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnucash-guile
|
||||
${Boost_LIBRARIES}
|
||||
PkgConfig::GTK3
|
||||
|
@ -487,7 +487,6 @@ load_gnucash_modules()
|
||||
gboolean optional;
|
||||
} modules[] =
|
||||
{
|
||||
{ "gnucash/engine", 0, FALSE },
|
||||
{ "gnucash/app-utils", 0, FALSE },
|
||||
{ "gnucash/gnome-utils", 0, FALSE },
|
||||
{ "gnucash/gnome-search", 0, FALSE },
|
||||
@ -518,15 +517,6 @@ load_gnucash_modules()
|
||||
gnc_module_load(modules[i].name, modules[i].version);
|
||||
DEBUG("Loading module %s finished", modules[i].name);
|
||||
}
|
||||
if (!gnc_engine_is_initialized())
|
||||
{
|
||||
/* On Windows this check used to fail anyway, see
|
||||
* https://lists.gnucash.org/pipermail/gnucash-devel/2006-September/018529.html
|
||||
* but more recently it seems to work as expected
|
||||
* again. 2006-12-20, cstim. */
|
||||
g_warning("GnuCash engine failed to initialize. Exiting.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -900,6 +890,7 @@ main(int argc, char ** argv)
|
||||
g_print("\n\n%s\n", userdata_migration_msg);
|
||||
|
||||
gnc_log_init();
|
||||
gnc_engine_init (0, NULL);
|
||||
|
||||
/* Write some locale details to the log to simplify debugging */
|
||||
PINFO ("System locale returned %s", sys_locale ? sys_locale : "(null)");
|
||||
|
@ -54,7 +54,7 @@ add_library (gncmod-html
|
||||
${html_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(gncmod-html gncmod-engine gnc-module gncmod-gnome-utils
|
||||
target_link_libraries(gncmod-html gnc-engine gnc-module gncmod-gnome-utils
|
||||
PkgConfig::GTK3 PkgConfig::WEBKIT ${GUILE_LDFLAGS})
|
||||
|
||||
target_compile_definitions(gncmod-html PRIVATE -DG_LOG_DOMAIN=\"gnc.html\")
|
||||
|
@ -73,12 +73,6 @@ extern SCM scm_init_sw_gnc_html_module( void );
|
||||
int
|
||||
libgncmod_html_gnc_module_init( int refcount )
|
||||
{
|
||||
/* load the engine (we depend on it) */
|
||||
if ( !gnc_module_load( "gnucash/engine", 0 ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( !gnc_module_load( "gnucash/app-utils", 0 ) )
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -51,7 +51,7 @@ add_library (gncmod-generic-import
|
||||
${generic_import_noinst_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(gncmod-generic-import gncmod-gnome-utils gncmod-engine PkgConfig::GTK3 ${GLIB2_LDFLAGS})
|
||||
target_link_libraries(gncmod-generic-import gncmod-gnome-utils gnc-engine PkgConfig::GTK3 ${GLIB2_LDFLAGS})
|
||||
|
||||
target_compile_definitions (gncmod-generic-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import\")
|
||||
|
||||
|
@ -56,7 +56,7 @@ if(WITH_AQBANKING)
|
||||
|
||||
target_link_libraries(gncmod-aqbanking gnc-gnome gncmod-gnome-utils
|
||||
gncmod-generic-import gncmod-register-core
|
||||
gncmod-register-gnome gncmod-ledger-core gncmod-engine gwengui-gtk3
|
||||
gncmod-register-gnome gncmod-ledger-core gnc-engine gwengui-gtk3
|
||||
${AQB_EXPORT_SYMBOLS} ${AQBANKING_LDFLAGS}
|
||||
${GWENHYWFAR_LDFLAGS}
|
||||
${GNOME_LDFLAGS} ${AQB_LIBSTDCXX})
|
||||
|
@ -62,8 +62,7 @@ gint
|
||||
libgncmod_aqbanking_gnc_module_init(gint refcount)
|
||||
{
|
||||
/* Load modules we depend on */
|
||||
if (!gnc_module_load("gnucash/engine", 0)
|
||||
|| !gnc_module_load("gnucash/app-utils", 0)
|
||||
if (!gnc_module_load("gnucash/app-utils", 0)
|
||||
|| !gnc_module_load("gnucash/gnome-utils", 0)
|
||||
|| !gnc_module_load("gnucash/import-export", 0))
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ set(test_aqb_INCLUDE_DIRS
|
||||
set(test_aqb_LIBS
|
||||
gncmod-aqbanking gncmod-generic-import gnc-gnome gncmod-gnome-utils
|
||||
gncmod-ledger-core gncmod-app-utils
|
||||
gncmod-backend-xml-utils gncmod-engine gnc-core-utils gnc-module
|
||||
gncmod-backend-xml-utils gnc-engine gnc-core-utils gnc-module
|
||||
${GLIB2_LDFLAGS}
|
||||
)
|
||||
|
||||
|
@ -22,7 +22,7 @@ target_link_libraries(gncmod-bi-import
|
||||
gncmod-gnome-utils
|
||||
gncmod-gnome-search
|
||||
gncmod-app-utils
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnc-core-utils
|
||||
gnc-module
|
||||
gnc-gnome
|
||||
|
@ -73,10 +73,6 @@ libgncmod_bi_import_gnc_module_init (int refcount)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load ("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (refcount == 0)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ set(csv_export_noinst_HEADERS
|
||||
|
||||
add_library(gncmod-csv-export ${csv_export_noinst_HEADERS} ${csv_export_SOURCES})
|
||||
|
||||
target_link_libraries(gncmod-csv-export gncmod-register-gnome gncmod-register-core gncmod-ledger-core gncmod-engine
|
||||
target_link_libraries(gncmod-csv-export gncmod-register-gnome gncmod-register-core gncmod-ledger-core gnc-engine
|
||||
gnc-module gncmod-gnome-utils gnc-gnome gncmod-app-utils gnc-core-utils)
|
||||
|
||||
target_compile_definitions(gncmod-csv-export PRIVATE -DG_LOG_DOMAIN=\"gnc.export.csv\")
|
||||
|
@ -59,10 +59,6 @@ libgncmod_csv_export_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_csv_export_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -69,7 +69,7 @@ target_link_libraries(
|
||||
gncmod-generic-import
|
||||
gncmod-gnome-utils
|
||||
gncmod-app-utils
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnc-core-utils
|
||||
gnc-module)
|
||||
|
||||
|
@ -59,10 +59,6 @@ libgncmod_csv_import_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_csv_import_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -7,7 +7,7 @@ set(CSV_IMP_TEST_INCLUDE_DIRS
|
||||
${CMAKE_SOURCE_DIR}/lib
|
||||
${GLIB2_INCLUDE_DIRS}
|
||||
)
|
||||
set(CSV_IMP_TEST_LIBS gncmod-csv-import gncmod-engine test-core)
|
||||
set(CSV_IMP_TEST_LIBS gncmod-csv-import gnc-engine test-core)
|
||||
|
||||
# This test does not run in Win32
|
||||
if (NOT WIN32)
|
||||
|
@ -18,7 +18,7 @@ set(customer_import_noinst_HEADERS
|
||||
add_library(gncmod-customer-import ${customer_import_SOURCES} ${customer_import_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-customer-import gnc-gnome gncmod-gnome-utils gncmod-app-utils
|
||||
gncmod-engine gnc-core-utils gnc-module ${GLIB2_LDFLAGS})
|
||||
gnc-engine gnc-core-utils gnc-module ${GLIB2_LDFLAGS})
|
||||
|
||||
target_include_directories(gncmod-customer-import
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -73,13 +73,6 @@ libgncmod_customer_import_gnc_module_init (int refcount)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
//if (!gnc_module_load ("gnucash/business-core", 0)) {
|
||||
// return FALSE;
|
||||
//}
|
||||
if (!gnc_module_load ("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (refcount == 0)
|
||||
{
|
||||
|
@ -58,10 +58,6 @@ libgncmod_generic_import_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_generic_import_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -15,7 +15,7 @@ set(log_replay_noinst_HEADERS
|
||||
|
||||
add_library(gncmod-log-replay ${log_replay_SOURCES} ${log_replay_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gncmod-engine
|
||||
target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gnc-engine
|
||||
gnc-core-utils gnc-module PkgConfig::GTK3)
|
||||
|
||||
target_compile_definitions(gncmod-log-replay PRIVATE -DG_LOG_DOMAIN=\"gnc.import.log-replay\")
|
||||
|
@ -61,10 +61,6 @@ libgncmod_log_replay_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_log_replay_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -20,7 +20,7 @@ set(ofx_UI gnc-plugin-ofx-ui.xml)
|
||||
if (WITH_OFX)
|
||||
add_library(gncmod-ofx ${ofx_SOURCES} ${ofx_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-ofx gncmod-generic-import gncmod-engine gncmod-app-utils gnc-core-utils
|
||||
target_link_libraries(gncmod-ofx gncmod-generic-import gnc-engine gncmod-app-utils gnc-core-utils
|
||||
gncmod-gnome-utils ${LIBOFX_LDFLAGS})
|
||||
|
||||
target_compile_definitions(gncmod-ofx PRIVATE -DG_LOG_DOMAIN=\"gnc.import.ofx\")
|
||||
|
@ -61,10 +61,6 @@ libgncmod_ofx_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_ofx_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -62,11 +62,6 @@ libgncmod_qif_import_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_qif_import_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -45,7 +45,7 @@ set_source_files_properties (${ledger_core_SOURCES} PROPERTIES OBJECT_DEPENDS ${
|
||||
add_library (gncmod-ledger-core ${ledger_core_SOURCES} ${ledger_core_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-ledger-core gncmod-register-gnome gncmod-register-core gncmod-gnome-utils
|
||||
gncmod-engine gnc-core-utils PkgConfig::GTK3)
|
||||
gnc-engine gnc-core-utils PkgConfig::GTK3)
|
||||
|
||||
target_compile_definitions (gncmod-ledger-core PRIVATE -DG_LOG_DOMAIN=\"gnc.register.ledger\")
|
||||
|
||||
|
@ -56,11 +56,6 @@ libgncmod_ledger_core_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_ledger_core_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/register/register-core", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -57,11 +57,6 @@ libgncmod_register_core_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_register_core_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* FIXME. We need this for the wide-character functions.
|
||||
* When fixing, get rid of gnome-utils includes, too. */
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
|
@ -60,12 +60,6 @@ extern SCM scm_init_sw_report_module(void);
|
||||
int
|
||||
libgncmod_report_gnc_module_init(int refcount)
|
||||
{
|
||||
/* load the engine (we depend on it) */
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -75,7 +75,7 @@ set_source_files_properties (${app_utils_SOURCES} PROPERTIES OBJECT_DEPENDS ${CO
|
||||
|
||||
set(app_utils_ALL_SOURCES ${app_utils_SOURCES} ${app_utils_HEADERS} ${app_utils_noinst_HEADERS})
|
||||
set(app_utils_ALL_LIBRARIES
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
gnc-module
|
||||
gnucash-guile
|
||||
${GIO_LDFLAGS}
|
||||
|
@ -80,12 +80,6 @@ extern SCM scm_init_sw_app_utils_module(void);
|
||||
int
|
||||
libgncmod_app_utils_gnc_module_init(int refcount)
|
||||
{
|
||||
/* load the engine (we depend on it) */
|
||||
if (!gnc_module_load("gnucash/engine", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
scm_init_sw_app_utils_module();
|
||||
/* publish swig bindings */
|
||||
/* load the scheme code */
|
||||
|
@ -77,7 +77,6 @@ main_helper (void *closure, int argc, char **argv)
|
||||
{
|
||||
int count = 50;
|
||||
|
||||
gnc_module_load("gnucash/engine", 0);
|
||||
gnc_module_load("gnucash/app-utils", 0);
|
||||
|
||||
if (argc > 1)
|
||||
|
@ -113,7 +113,6 @@ static void
|
||||
main_helper (void *closure, int argc, char **argv)
|
||||
{
|
||||
gnc_module_system_init ();
|
||||
gnc_module_load("gnucash/engine", 0);
|
||||
gnc_module_load("gnucash/app-utils", 0);
|
||||
|
||||
xaccLogDisable ();
|
||||
|
@ -33,7 +33,7 @@ if (WITH_SQL)
|
||||
if(MINGW64)
|
||||
set(WINSOCK_LIB "-lws2_32")
|
||||
endif(MINGW64)
|
||||
target_link_libraries(gncmod-backend-dbi gnc-backend-sql gncmod-engine ${GTK2_LDFLAGS} ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY} ${WINSOCK_LIB})
|
||||
target_link_libraries(gncmod-backend-dbi gnc-backend-sql gnc-engine ${GTK2_LDFLAGS} ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY} ${WINSOCK_LIB})
|
||||
|
||||
target_compile_definitions(gncmod-backend-dbi PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.dbi\")
|
||||
|
||||
|
@ -10,7 +10,7 @@ set(BACKEND_DBI_TEST_INCLUDE_DIRS
|
||||
${LIBDBI_INCLUDE_PATH}
|
||||
${GLIB2_INCLUDE_DIRS}
|
||||
)
|
||||
set(BACKEND_DBI_TEST_LIBS gnc-backend-sql gncmod-engine gncmod-test-engine test-core ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY})
|
||||
set(BACKEND_DBI_TEST_LIBS gnc-backend-sql gnc-engine gncmod-test-engine test-core ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY})
|
||||
|
||||
set(test_dbi_backend_SOURCES
|
||||
test-backend-dbi.cpp
|
||||
|
@ -69,7 +69,7 @@ if(WITH_SQL)
|
||||
${backend_sql_noinst_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(gnc-backend-sql gncmod-engine)
|
||||
target_link_libraries(gnc-backend-sql gnc-engine)
|
||||
|
||||
target_compile_definitions (gnc-backend-sql PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.sql\")
|
||||
|
||||
|
@ -9,7 +9,7 @@ set(BACKEND_SQL_TEST_INCLUDE_DIRS
|
||||
|
||||
set(test_backend_sql_SOURCES test-sqlbe.cpp utest-gnc-backend-sql.cpp)
|
||||
|
||||
set(BACKEND_SQL_TEST_LIBS gnc-backend-sql gncmod-engine test-core)
|
||||
set(BACKEND_SQL_TEST_LIBS gnc-backend-sql gnc-engine test-core)
|
||||
|
||||
set_dist_list(test_backend_sql_DIST ${test_backend_sql_SOURCES} CMakeLists.txt
|
||||
test-column-types.cpp)
|
||||
|
@ -82,7 +82,7 @@ add_library (gnc-backend-xml-utils
|
||||
${backend_xml_utils_noinst_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(gnc-backend-xml-utils gncmod-engine ${LIBXML2_LDFLAGS} ${ZLIB_LDFLAGS})
|
||||
target_link_libraries(gnc-backend-xml-utils gnc-engine ${LIBXML2_LDFLAGS} ${ZLIB_LDFLAGS})
|
||||
|
||||
target_include_directories (gnc-backend-xml-utils
|
||||
PUBLIC ${LIBXML2_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@ -104,7 +104,7 @@ set(libgncmod_backend_xml_SOURCES gnc-backend-xml.cpp)
|
||||
set_source_files_properties (${libgncmod_backend_xml_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
|
||||
|
||||
add_library(gncmod-backend-xml MODULE ${libgncmod_backend_xml_SOURCES})
|
||||
target_link_libraries(gncmod-backend-xml gnc-backend-xml-utils gncmod-engine
|
||||
target_link_libraries(gncmod-backend-xml gnc-backend-xml-utils gnc-engine
|
||||
gnc-core-utils ${LIBXML2_LDFLAGS} ${GLIB2_LDFLAGS} ${ZLIB_LIBRARY})
|
||||
|
||||
target_compile_definitions (gncmod-backend-xml PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.xml\" -DU_SHOW_CPLUSPLUS_API=0)
|
||||
@ -128,6 +128,6 @@ install(TARGETS gncmod-backend-xml
|
||||
|
||||
# Special normal (non-MODULE) library for cutecash only
|
||||
add_library(gncmod-backend-xml-utils ${libgncmod_backend_xml_SOURCES})
|
||||
target_link_libraries(gncmod-backend-xml-utils gnc-backend-xml-utils gncmod-engine
|
||||
target_link_libraries(gncmod-backend-xml-utils gnc-backend-xml-utils gnc-engine
|
||||
gnc-core-utils ${LIBXML2_LDFLAGS} ${GLIB2_LDFLAGS} ${ZLIB_LIBRARY})
|
||||
target_compile_definitions (gncmod-backend-xml-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.xml\" -DU_SHOW_CPLUSPLUS_API=0)
|
||||
|
@ -62,9 +62,6 @@ extern "C"
|
||||
int
|
||||
libgncmod_backend_file_gnc_module_init (int refcount)
|
||||
{
|
||||
engine = gnc_module_load ("gnucash/engine", 0);
|
||||
if (!engine) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ set(XML_TEST_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
|
||||
set(XML_TEST_LIBS gncmod-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lz)
|
||||
set(XML_TEST_LIBS gnc-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lz)
|
||||
|
||||
function(add_xml_test _TARGET _SOURCE_FILES)
|
||||
gnc_add_test(${_TARGET} "${_SOURCE_FILES}" XML_TEST_INCLUDE_DIRS XML_TEST_LIBS ${ARGN})
|
||||
|
@ -78,8 +78,7 @@ main (int argc, char** argv)
|
||||
location = "../../../../data/accounts/C";
|
||||
}
|
||||
|
||||
gnc_module_system_init ();
|
||||
gnc_module_load ("gnucash/engine", 0);
|
||||
gnc_engine_init (0, NULL);
|
||||
|
||||
if ((ea_dir = g_dir_open (location, 0, NULL)) == NULL)
|
||||
{
|
||||
|
@ -155,7 +155,6 @@ set (engine_SOURCES
|
||||
gnc-session.c
|
||||
gnc-timezone.cpp
|
||||
gnc-uri-utils.c
|
||||
gncmod-engine.c
|
||||
engine-helpers.c
|
||||
guid.cpp
|
||||
policy.c
|
||||
@ -200,22 +199,22 @@ set_source_files_properties (${engine_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFI
|
||||
# Add dependency on iso-4217-currencies.c
|
||||
set_source_files_properties (gnc-commodity.c PROPERTIES OBJECT_DEPENDS "${ISO_4217_C};${CONFIG_H}")
|
||||
|
||||
add_library (gncmod-engine
|
||||
add_library (gnc-engine
|
||||
${engine_SOURCES}
|
||||
${engine_HEADERS}
|
||||
${engine_noinst_HEADERS}
|
||||
)
|
||||
|
||||
target_sources(gncmod-engine
|
||||
target_sources(gnc-engine
|
||||
PRIVATE
|
||||
$<$<BOOL:${WIN32}>:qof-win32.cpp>
|
||||
$<$<BOOL:${WIN32}>:${CMAKE_SOURCE_DIR}/borrowed/libc/strptime.c>
|
||||
)
|
||||
|
||||
# Add dependency on iso-4217-currencies.c
|
||||
add_dependencies (gncmod-engine iso-4217-c)
|
||||
add_dependencies (gnc-engine iso-4217-c)
|
||||
|
||||
target_link_libraries(gncmod-engine
|
||||
target_link_libraries(gnc-engine
|
||||
gnc-core-utils
|
||||
gnc-module
|
||||
${Boost_DATE_TIME_LIBRARIES}
|
||||
@ -227,9 +226,9 @@ target_link_libraries(gncmod-engine
|
||||
${GOBJECT_LDFLAGS}
|
||||
$<$<BOOL:${WIN32}>:bcrypt.lib>)
|
||||
|
||||
target_compile_definitions (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
|
||||
target_compile_definitions (gnc-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
|
||||
|
||||
target_include_directories (gncmod-engine
|
||||
target_include_directories (gnc-engine
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
|
||||
PUBLIC
|
||||
@ -243,12 +242,12 @@ target_include_directories (gncmod-engine
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
set_target_properties (gncmod-engine PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
|
||||
set_target_properties (gnc-engine PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
install(TARGETS gncmod-engine
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
|
||||
install(TARGETS gnc-engine
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
install(FILES ${engine_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnucash)
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*********************************************************************
|
||||
* gnc-mod-engine.c
|
||||
* module definition/initialization for the Engine module
|
||||
*
|
||||
* Copyright (c) 2001 Linux Developers Group, Inc.
|
||||
*********************************************************************/
|
||||
/********************************************************************\
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-module-api.h"
|
||||
|
||||
GNC_MODULE_API_DECL(libgncmod_engine)
|
||||
|
||||
/* version of the gnc module system interface we require */
|
||||
int libgncmod_engine_gnc_module_system_interface = 0;
|
||||
|
||||
/* module versioning uses libtool semantics. */
|
||||
int libgncmod_engine_gnc_module_current = 0;
|
||||
int libgncmod_engine_gnc_module_revision = 0;
|
||||
int libgncmod_engine_gnc_module_age = 0;
|
||||
|
||||
|
||||
char *
|
||||
libgncmod_engine_gnc_module_path(void)
|
||||
{
|
||||
return g_strdup("gnucash/engine");
|
||||
}
|
||||
|
||||
char *
|
||||
libgncmod_engine_gnc_module_description(void)
|
||||
{
|
||||
return g_strdup("The GnuCash accounting engine");
|
||||
}
|
||||
|
||||
int
|
||||
libgncmod_engine_gnc_module_init(int refcount)
|
||||
{
|
||||
if (refcount == 0)
|
||||
{
|
||||
/* initialize the engine on the first load */
|
||||
gnc_engine_init(0, NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
libgncmod_engine_gnc_module_end(int refcount)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
@ -9,7 +9,7 @@ set(ENGINE_TEST_INCLUDE_DIRS
|
||||
${GLIB2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(ENGINE_TEST_LIBS gncmod-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lm)
|
||||
set(ENGINE_TEST_LIBS gnc-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lm)
|
||||
|
||||
macro(add_engine_test _TARGET _SOURCE_FILES)
|
||||
gnc_add_test(${_TARGET} "${_SOURCE_FILES}" ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
|
||||
@ -89,7 +89,7 @@ add_engine_test(test-numeric "${test_numeric_SOURCES}")
|
||||
|
||||
set(MODULEPATH ${CMAKE_SOURCE_DIR}/libgnucash/engine)
|
||||
set(gtest_old_engine_LIBS
|
||||
gncmod-engine
|
||||
gnc-engine
|
||||
${GLIB2_LDFLAGS}
|
||||
${Boost_LIBRARIES}
|
||||
gtest)
|
||||
|
@ -65,10 +65,6 @@ libgncmod_example_gnc_module_description (void)
|
||||
int
|
||||
libgncmod_example_gnc_module_init (int refcount)
|
||||
{
|
||||
if (!gnc_module_load ("gnucash/engine", 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (refcount == 0) {
|
||||
/* this is the first time the module is loaded */
|
||||
|
||||
|
@ -644,7 +644,6 @@ libgnucash/engine/gnc-int128.cpp
|
||||
libgnucash/engine/gncInvoice.c
|
||||
libgnucash/engine/gncJob.c
|
||||
libgnucash/engine/gnc-lot.c
|
||||
libgnucash/engine/gncmod-engine.c
|
||||
libgnucash/engine/gnc-numeric.cpp
|
||||
libgnucash/engine/gncOrder.c
|
||||
libgnucash/engine/gncOwner.c
|
||||
|
Loading…
Reference in New Issue
Block a user