Commit Graph

59 Commits

Author SHA1 Message Date
Christopher Lam
d488faacb2 [gnc-commodity.cpp] Convert to cpp 2024-02-17 22:55:40 +08:00
Christopher Lam
03c5309666 [gnc-lot.cpp] convert to cpp 2024-02-09 17:23:51 +08:00
Christopher Lam
7d8d8f83be [Recurrence.cpp] convert to cpp 2024-02-09 17:23:51 +08:00
Christopher Lam
783c3df3c0 [Transaction.cpp] convert to cpp 2024-02-09 17:23:51 +08:00
Christopher Lam
fc5d7f872e [Split.cpp] convert to cpp 2024-02-09 17:23:51 +08:00
John Ralls
6834cb5025 Implement coverage option
To use pass -DCMAKE_BUILD_TYPE=Debug or Asan -DCOVERAGE=ON and build as
usual, then do ninja lcov-initialize && ninja check && ninja
lcov-collect. The result will be a directory, <Builddir>/Coverage
containing lcov tracefiles, including an aggregate file gnucash.info
which you can use for further processing. It will also report an overall summary.
Note that only C/C++ files are included.

There's one more target, lcov-generate-html, that you can run after
lcov-collect. It will generate a simple website in
<Builddir>/Coverage-HTML showing coverage by source directory (the
directories in <Builddir> have coverage for generated files). Each
directory path is a clickable link to a page that shows coverage for
each source file; the filenames link to a page for each showing which
lines have been exercised.
2023-12-08 14:53:02 -08:00
Christopher Lam
e841ceaaa1 [gnc-pricedb.cpp] convert to cpp 2023-07-23 15:19:43 +08:00
Richard Cohen
bddb4468fa Import GLIB2 as a target, and use it to simplify the CMakeLists 2023-02-21 12:59:42 +00:00
Christopher Lam
fc94b41c81 Merge branch 'maint' 2022-10-29 21:53:57 +08:00
John Ralls
cf088f2a70 Merge John Ralls's 'Bug798614' into maint. 2022-10-28 15:27:28 -07:00
Christopher Lam
8192deff37 [gnc-features.cpp] convert to cpp
- don't need to create/destroy GHashTable for each feature query
- plugs leak: g_hash_table_unref (features_used) not always called properly
- to check 1 feature, don't need to traverse whole GHashTable
2022-10-28 20:50:35 +08:00
Geert Janssens
a6771754d5 GncQuotes - start implementation of fetch/fetch_all 2022-10-02 11:50:25 -07:00
John Ralls
d8417c3cfa Move gnc-euro.[ch] to engine and unit test it. 2022-09-30 15:12:12 -07:00
John Ralls
4ae17d12c7 [options] Move options from app-utils to engine.
Options is required for book options that are stored as part of the data
 file and so belongs in engine.
2022-08-25 22:09:56 -07:00
Christopher Lam
193a7aae5d Merge branch 'maint' 2022-03-12 15:18:43 +08:00
Christopher Lam
9088acabd8 [gnc-budget.cpp] convert to c++ 2022-03-02 07:13:24 +08:00
Christopher Lam
73822f97a9 [1/2][Scrubbudget.c] use heuristics to scrub budget signs
If book has budgets, and GNC_FEATURE_BUDGET_UNREVERSED isn't set,
check and fix budget amount signs. Previously budgets were created
with assumption that sign reversal was set to credit amounts. A
heuristic approach is used:

- if budgeted expense is negative, conclude sign reversal is
"Income and Expense"

- if budgeted liability is positive, conclude sign reversal is
"None"

- otherwise conclude sign reversal is "Credit Accounts"

The above is calibrated to (hopefully) prefer sign reversal of Credit
Accounts.
2021-12-03 17:40:21 +08:00
John Ralls
bcbebe62b1 Make xaccScrubUtilityGetOrMakeAccount static and remove ScrubP.h
It being the only declaration in ScrubP.h
2021-01-27 17:44:21 -08:00
Geert Janssens
5fc2b9519c Add mock sources and import-export test to dist 2020-05-29 17:20:53 +02:00
John Ralls
94fdc42f16 Fix wrong Boost library variable names. 2020-05-11 12:35:42 -07:00
Geert Janssens
bbeb9a2b62 Drop all gnc-module dependencies and includes from compilation units that no longer use it
This also drops the python wrapper for gnc-module. As for the guile wrappers,
python should use other means of loading our shared libraries.

This commit required a few tweaks to the dependency chain as some units
inherited dependency information from gnc-module's public dependency
interface.
2020-04-24 22:16:24 +02:00
Geert Janssens
301db9020d Merge branch 'maint' 2020-02-06 16:50:08 +01:00
Geert Janssens
e79e82edcf CMake - remove parameter repetition in else() and endif() statements
This follows Professional CMake's recommended practises
2020-02-05 11:38:14 +01:00
Geert Janssens
4c77f7670e 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.
2019-12-06 20:38:21 +01:00
Geert Janssens
0a635fadee engine - cmake cleanups
- drop no longer used GUILE_LDFLAGS and GUILE_INCLUDE_DIRS
- use generator expressions where it makes sense
2019-12-06 19:59:11 +01:00
Geert Janssens
2e1b9f937b engine - drop guile wrappers for obsolete functions
These were marked deprecated early in the 3.x release cycle.
2019-12-06 19:59:11 +01:00
Geert Janssens
1c7f835f47 engine - move guile code to bindings/guile
This commit tries to do the minimum necessary to move the guile bits from engine
to bindings/guile. As engine is a very central piece in the software, this unfortunately
still touches many other source files:

- A few helper objects have been squashed together:
  * engine-helpers-guile.[ch] (of which the c part is extracted from engine-helpers.c)
  * gncBusGuile.[ch]
  * gnc-hooks-scm.[ch]
- The initialization function of gncmod-engine no longer initializes the scm bits.
  Any scm code that wants to interact with the engine code now has to load
  the (gnucash engine) scm module, or sometimes (gnucash business-core).
  The bulk of changes in this commit actually is updating all the scm consumers to do so.
- scm-scm target has been removed. Instead (gnucash utilities) is part
  of scm-engine. A few dependency graphs have been updated for this.

More refinements will be in followup commits.
2019-12-06 19:59:11 +01:00
Geert Janssens
b1ba16c33b gnc-hooks - factor out scm calls into a separate source file
This required the addition of an extra parameter to gnc_hook_add_dangler
to allow the scm hooks to unprotect the scm data on hook destruction.
2019-12-06 19:59:11 +01:00
Geert Janssens
18093b5e82 core-utils - move guile utils to bindings/guile 2019-12-06 19:59:11 +01:00
Geert Janssens
33e1ff645c Allow to pass include directories to the add_swig_xyz commands
This will be needed when the wrappers no longer live in
the same directory as the objects they are wrapping.
2019-12-06 19:59:11 +01:00
Geert Janssens
f5e28c3d0f split register - drop scm copy interface 2019-12-06 19:41:50 +01:00
John Ralls
b8b33b9591 Revert "More conversions from pkg-config variables to imported targets."
This reverts commit 1a9fcfefad because
on MinGW cmake complains about the paths in pkgconfig files. This can
be addressed by using the MSYS2 cmake instead of the MINGW32 one, but
that requires some other changes... and there's also a path separator
bug in that version of FindPkgConfig.cmake.
2019-09-21 15:53:25 -07:00
John Ralls
6753b30b86 Convert GtkMacIntegration to package-style dependencies. 2019-09-15 12:27:43 -07:00
John Ralls
1a9fcfefad More conversions from pkg-config variables to imported targets.
Also converts ICU detection from pkgconfig to FindICU.
2019-09-13 17:05:35 -07:00
Geert Janssens
0e93e95c6c Merge maint 2019-08-17 12:53:55 +02:00
John Ralls
24d4576617 Include libicu-i18n in libgncmod-engine linkage for new ICU API usage. 2019-08-15 15:17:16 -07:00
Geert Janssens
53f59f7794 RptCleanup - Restructure installation of gnucash scm files
These files were installed fairly ad-hoc into the share/gnucash/scm directory making
it hard to get an idea of where each file comes from.
The files are now structured as follows:
- any scm file authored by gnucash should go in share/gnucash/scm/gnucash or below
- most scm modules will be directly in that directory
- each module that comes with support files will get a subdirectory named after the
  module's base name. For example next to engine.scm there will be directory
  named engine for all support files of the engine module
- scm files that are not modules, but are loaded by modules go into
  <module-dir>. For example gnc-utils.scm loads gnc-menu-extensions.scm
  so that file will be installed in gnc-utils/gnc-menu-extensions.scm
- the report system is our largest module and only part of the restructuring
  is done at this point. It will be refined further in future commits.

The same restructuring is also done for the compiled files.
2019-06-18 14:25:04 +02:00
John Ralls
f5be842c2e boost needs bcrypt.lib for all versions of Windows. 2018-12-16 16:31:06 -08:00
John Ralls
f6fb1101bd Add bcrypt.lib to engine build flags on Windows < 10.
Seems not to be required on Win10.
2018-10-29 11:27:16 -07:00
John Ralls
b7be8d59b7 Remove engine-deprecated.i from CMakeLists.txt.
It wasn't created in the timespec functions deprecation commit.
2018-09-29 13:01:29 -07:00
Geert Janssens
4c87dd05ec Fix compiler warning issues
- add -Wno-deprecated-declarations to CXX_FLAGS as well. This was
  reported by vorlonofportland in PR#401 to become necessary for glib 2.58
  as that has deprecated g_type_class_add_private which appears in our
  c++ code.
- change -Wno-deprecated-register into -Wregister. The former appeared to
  be a clang dialect and alias for the latter (see
  https://github.com/Barro/compiler-warnings for an overview of clang
  and gcc warnings). It was moved to global CXX_FLAGS as it can only be
  added for g++.
2018-09-01 12:07:38 +02:00
John Ralls
c08dee67ba Preserve timespec-using functions in Guile bindings.
There's an example of use in text-extras.scm, function
gnc-pricedb-create.

Unfortunately the deprecation messages issue no warnings.
2018-08-16 10:47:41 -07:00
Geert Janssens
a9f35ed7ae Lowercase cmake commands
A huge bikeshed fest but it distracted me enough to do it anyway.
2018-05-03 23:18:15 +02:00
John Ralls
a5f46a5e45 More Scheme dependency additions. 2018-02-18 15:59:00 -08:00
Geert Janssens
49a936c1fd Rewrite gnc_add_swig_guile_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
ec213360f3 Review which built files are really needed in the dist tarball
Several were only there because they used to be generated via autogen.sh
and hence had to be included because autogen.sh was not supposed to be run
in a tarball based build.
A few others aren't clear so I have left them in for now:
- gnucash.1 (man page)
- gnucash-design.info (because it's unclear what we want to do with that one)

These files should clearly be in the tarball:
- gnucash.pot -> for our translators
- ChangeLog -> can't be generated outside of a git repo
- gnc-vcs-info.h -> can't be generated outside of a git repo
- guile/python bindings -> to avoid a swig dependency when building from tarball
2018-01-29 19:46:44 +01:00
Geert Janssens
4317d8a8f6 Improve handling of generated distributable files
- the two dist_add_... macros now both take a list of file names
as argument so more files can be added at once to the dist tarball.
- dist_add_generated now creates the right target by itself. There's
  no need to pass one any more
- make the swig generated *.py module files explicit output files
- change a couple of custom_targets into custom_commands. The only
  reason they were defined as targets was to ensure they got built
  before the dist tarball. This is now properly handled by the
  dist_add_... macros.
- correctly handle dependency on swig-runtime.h (using OBJECT_DEPENDS
  was not the way to do it according to that property's help page)
2018-01-29 19:46:44 +01:00
Geert Janssens
3dff4e5211 Fix make dist on a clean checkout
cmake with unix makefiles fails to resolve dist dependencies
added from COPY_FROM_BUILD if these dependencies aren't built yet.

This commit replaces the COPY_FROM_BUILD based logic with two new functions
'dist_add_configured' and 'dist_add_generated' to indicate which files should
be included in the dist tarball. The latter also adds a target level dependency
to the dist tarball custom command. Hence the former should
be used for files that get generated during a cmake run while the latter
should be used for files generated as the result of a 'make/ninja-build' run
(like files for which an add_custom_command rule exists).

Note: this commit also temporarily disables the dist target when building
from a tarball (and hence it won't be tested in distcheck either). This
will be handled in a future commit.
2018-01-29 19:46:44 +01:00
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
John Ralls
91727525b9 Enforce -Werror on C++ files and fix resulting errors. 2017-12-26 15:18:43 -08:00