Commit Graph

955 Commits

Author SHA1 Message Date
Martchus 5509caff89 Remove unused `META_CONFIG_PREFIX`
This variable was never actually used. I suppose I've been adding it for
places where the config should be added as a prefix. However, this would be
inconsistent and now would also mean a confusing overlap with the
namespacing feature. So let's just remove it.
2021-10-03 23:11:14 +02:00
Martchus 072b7b5136 Apply cmake-format 2021-10-03 23:06:20 +02:00
Martchus 347e283e8b
Merge pull request #21 from hrittich/upstream-patches
Fix namespace for file names
2021-10-03 19:48:57 +02:00
Hannah Rittich b8eee6d9d6 Fix namespace for file names 2021-10-03 02:13:27 +02:00
Martchus 2fc54ecdaa
Merge pull request #20 from hrittich/tmp
Allow configuration name as prefix
2021-10-02 21:58:07 +02:00
Hannah Rittich 3730830880 Added namespace for file names 2021-10-02 21:08:10 +02:00
Martchus a9e3d37681 Document `TLS_SUPPORT` and `META_TLS_PLUGINS` variables 2021-10-02 20:21:15 +02:00
Martchus 9c9a47e551 Define `QT_STATICPLUGIN` when building static Qt plugins
This requirement is documented here:
https://doc.qt.io/qt-5/plugins-howto.html#creating-static-plugins
2021-09-16 18:36:35 +02:00
Martchus 030e6a2034 Source required packages before adding target
The config script for adding the target (which is generated
by CMake) otherwise complains that referenced dependencies
are missing. Not sure why this was never a problem. Maybe
the packages were just present anyways or CMake added
additional checks at some point.
2021-09-16 01:06:35 +02:00
Martchus 3a52ae5e22 Prevent attempt to strip import lib for static plugin 2021-09-16 01:05:41 +02:00
Martchus 48c7906bf6 Do not export include dirs for plugins
Plugins don't have headers and the non-existant
include directory leads otherwise to configuration
errors when trying to link against a static plugin.
2021-09-16 01:04:19 +02:00
Martchus 18295c98ec Fix exporting list of required CMake packages 2021-09-11 21:31:17 +02:00
Martchus 6d0148e2c3 Allow overriding BUILD_SHARED_LIBS via a project-specific cache variable 2021-09-11 17:07:43 +02:00
Martchus af0294f0fb Apply cmake-format 2021-08-25 19:38:52 +02:00
Martchus 1b6ffb561a Fix locating files which are directly under the data dir (and not in the cmake dir) 2021-08-25 19:38:43 +02:00
Martchus 643112931c Fix wrong usage of `APPEND` when marking Windows resource file as generated 2021-08-25 00:56:04 +02:00
Martchus 9b293ab5d5 Document recently introduced CMake variables 2021-08-21 23:39:35 +02:00
Martchus f55dc67a93 Fix `option(BUILD_SHARED_LIBS …)`
* Fix order of arguments
* Keep building static libraries by default to stick with CMake's default
  except when devel defaults are enabled and we're targeting GNU/Linux
2021-08-21 23:39:17 +02:00
Martchus c2ab0d8e29 Document `CMAKE_FIND_DEBUG_MODE` 2021-08-07 17:09:24 +02:00
Martchus 15fddad46d Log error when "srcdirref" cannot be opened 2021-08-03 14:05:33 +02:00
Martchus 8961cf3a32 Add `META_TIDY_EXCLUDE_REGEX` to exclude files from tidy target
This can be useful to exclude 3rd party files.
2021-08-02 16:49:37 +02:00
Martchus 2de07d4cd0 Consider `*.cc` and `*.hh` files formatable 2021-08-02 16:48:35 +02:00
Martchus b16fff4b0a Test splitString*() with an empty input 2021-07-24 23:38:44 +02:00
Martchus 203679bf32 Document that delimiter for splitString*() must not be empty 2021-07-24 23:38:12 +02:00
Martchus 2bb04c64ea Use std::string_view::value_type in BufferSearch 2021-07-16 15:58:40 +02:00
Martchus 77b2c3281f Add overload to BufferSearch required by arch-repo-manager 2021-07-16 15:56:28 +02:00
Martchus 6558ff487a Add BufferSearch (from arch-repo-manager) to use it in syncthingtray as well 2021-07-15 02:24:28 +02:00
Martchus db87472be9 Unify and improve code for finding OpenSSL
* Unify code for use_openssl and use_crypto
* Make missing OpenSSL targets a fatal error if OpenSSL is required
* Add note that possibly the devel package is missing
    * Under Tumbleweed with missing devel package I've got `OpenSSL_FOUND`
      but no imported targets because the symlink from the devel package
      was missing. This might be due to stale values within the CMake
      cache.
2021-07-07 20:51:57 +02:00
Martchus eace9b44ec Fix linking statically against OpenSSL
`set(… PARENT_SCOPE)` leaves the current scope unaffected so appending the
static dependencies removed the OpenSSL libs themselves again.
2021-07-06 20:02:49 +02:00
Martchus 5291c746df Show warning when OpenSSL can be found but imported targets are not present 2021-07-06 19:48:21 +02:00
Martchus b3ebe5ce38 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:07:49 +02:00
Martchus 6d1f242edc Fix typo 2021-06-27 18:51:27 +02:00
Martchus 2d50799cff Set C++ standard within `use_standard_filesystem()` in a generic way
It is important that `cmake_policy(SET CMP0067 NEW)` is set before
`include(CheckCXXSourceCompiles)`.
2021-06-22 16:14:59 +02:00
Martchus e961eb9726 Extend compile test for standard filesystem
Apparently the current compile check is not sufficient:

```
[   54s] -- The C compiler identification is GNU 8.2.1
[   54s] -- The CXX compiler identification is GNU 8.2.1
[   54s] -- Check for working C compiler: /usr/bin/gcc-8
[   54s] -- Check for working C compiler: /usr/bin/gcc-8 - works
[   54s] -- Detecting C compiler ABI info
[   54s] -- Detecting C compiler ABI info - done
[   54s] -- Detecting C compile features
[   54s] -- Detecting C compile features - done
[   54s] -- Check for working CXX compiler: /usr/bin/g++-8
[   55s] -- Check for working CXX compiler: /usr/bin/g++-8 - works
…
[   55s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0
[   55s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0 - Success
[   55s] -- Linking tageditor against special library for std::filesystem support is not required.
…
[  109s] FAILED: tageditor
[  109s] : && /usr/bin/g++-8  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -DNDEBUG -O2 -g -DNDEBUG  -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now    -rdynamic CMakeFiles/tageditor.dir/tageditor_autogen/mocs_compilation.cpp.o CMakeFiles/tageditor.dir/application/main.cpp.o CMakeFiles/tageditor.dir/cli/attachmentinfo.cpp.o CMakeFiles/tageditor.dir/cli/fieldmapping.cpp.o CMakeFiles/tageditor.dir/cli/helper.cpp.o CMakeFiles/tageditor.dir/cli/mainfeatures.cpp.o CMakeFiles/tageditor.dir/application/knownfieldmodel.cpp.o CMakeFiles/tageditor.dir/application/targetlevelmodel.cpp.o CMakeFiles/tageditor.dir/application/settings.cpp.o CMakeFiles/tageditor.dir/gui/fileinfomodel.cpp.o CMakeFiles/tageditor.dir/misc/htmlinfo.cpp.o CMakeFiles/tageditor.dir/misc/utility.cpp.o CMakeFiles/tageditor.dir/gui/attachmentsedit.cpp.o CMakeFiles/tageditor.dir/gui/attachmentsmodel.cpp.o CMakeFiles/tageditor.dir/gui/codeedit.cpp.o CMakeFiles/tageditor.dir/gui/entertargetdialog.cpp.o CMakeFiles/tageditor.dir/gui/mainwindow.cpp.o CMakeFiles/tageditor.dir/gui/minimumemptyspinbox.cpp.o CMakeFiles/tageditor.dir/gui/notificationlabel.cpp.o CMakeFiles/tageditor.dir/gui/notificationmodel.cpp.o CMakeFiles/tageditor.dir/gui/pathlineedit.cpp.o CMakeFiles/tageditor.dir/gui/picturepreviewselection.cpp.o CMakeFiles/tageditor.dir/gui/filefilterproxymodel.cpp.o CMakeFiles/tageditor.dir/gui/initiate.cpp.o CMakeFiles/tageditor.dir/gui/javascripthighlighter.cpp.o CMakeFiles/tageditor.dir/gui/renamefilesdialog.cpp.o CMakeFiles/tageditor.dir/gui/settingsdialog.cpp.o CMakeFiles/tageditor.dir/gui/tagedit.cpp.o CMakeFiles/tageditor.dir/gui/tagfieldedit.cpp.o CMakeFiles/tageditor.dir/gui/tageditorwidget.cpp.o CMakeFiles/tageditor.dir/dbquery/dbquery.cpp.o CMakeFiles/tageditor.dir/dbquery/musicbrainz.cpp.o CMakeFiles/tageditor.dir/dbquery/makeitpersonal.cpp.o CMakeFiles/tageditor.dir/dbquery/lyricswikia.cpp.o CMakeFiles/tageditor.dir/gui/dbquerywidget.cpp.o CMakeFiles/tageditor.dir/misc/networkaccessmanager.cpp.o CMakeFiles/tageditor.dir/renamingutility/filesystemitem.cpp.o CMakeFiles/tageditor.dir/renamingutility/filesystemitemmodel.cpp.o CMakeFiles/tageditor.dir/renamingutility/filteredfilesystemitemmodel.cpp.o CMakeFiles/tageditor.dir/renamingutility/renamingengine.cpp.o CMakeFiles/tageditor.dir/renamingutility/tageditorobject.cpp.o CMakeFiles/tageditor.dir/tageditor_autogen/3YJK5W5UP7/qrc_icons.cpp.o CMakeFiles/tageditor.dir/tageditor_autogen/3YJK5W5UP7/qrc_scripts.cpp.o CMakeFiles/tageditor.dir/tageditor_autogen/JU62CA5L7X/qrc_tageditor_translations.cpp.o  -o tageditor  /usr/lib64/libqtutilities.so.6.4.1  /usr/lib64/libtagparser.so.10.0.0  /usr/lib64/libQt5Concurrent.so.5.12.7  /usr/lib64/libQt5WebEngineWidgets.so.5.15.3  /usr/lib64/libc++utilities.so.5.10.4  /usr/lib64/libQt5WebEngineCore.so.5.15.3  /usr/lib64/libQt5WebChannel.so.5.12.7  /usr/lib64/libQt5Positioning.so.5.12.7  /usr/lib64/libQt5Quick.so.5.12.7  /usr/lib64/libQt5Qml.so.5.12.7  /usr/lib64/libQt5Network.so.5.12.7  /usr/lib64/libQt5PrintSupport.so.5.12.7  /usr/lib64/libQt5Widgets.so.5.12.7  /usr/lib64/libQt5Gui.so.5.12.7  /usr/lib64/libQt5Core.so.5.12.7 && :
[  109s] /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/tageditor.dir/cli/mainfeatures.cpp.o: in function `Cli::setTagInfo(Cli::SetTagInfoArgs const&)':
[  109s] /home/abuild/rpmbuild/BUILD/tageditor-3.4.0/build/../cli/mainfeatures.cpp:889: undefined reference to `std::filesystem::last_write_time(std::filesystem::__cxx11::path const&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, std::error_code&)'
[  109s] collect2: error: ld returned 1 exit status
```

For `c++utilities` itself it doesn't seem to matter:

```
[   33s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0
[   35s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0 - Success
[   35s] -- Linking c++utilities against special library for std::filesystem support is not required.
…
[   43s] [22/22] /usr/bin/cmake -E cmake_symlink_library libc++utilities.so.5.10.4  libc++utilities.so.5 libc++utilities.so && :
[   43s] + RPM_EC=0
```

For some reason the AppImage build doesn't have the problem:

```
[   77s] -- The C compiler identification is GNU 8.2.1
[   77s] -- The CXX compiler identification is GNU 8.2.1
[   77s] -- Check for working C compiler: /usr/bin/gcc-8
[   77s] -- Check for working C compiler: /usr/bin/gcc-8 -- works
[   77s] -- Detecting C compiler ABI info
[   78s] -- Detecting C compiler ABI info - done
[   78s] -- Detecting C compile features
[   78s] -- Detecting C compile features - done
[   78s] -- Check for working CXX compiler: /usr/bin/g++-8
[   78s] -- Check for working CXX compiler: /usr/bin/g++-8 -- works
[   78s] -- Detecting CXX compiler ABI info
[   78s] -- Detecting CXX compiler ABI info - done
[   78s] -- Detecting CXX compile features
[   79s] -- Detecting CXX compile features - done
[   79s] -- Looking for iconv
[   79s] -- Looking for iconv - found
[   79s] -- Using iconv from the standard library for target c++utilities.
[   79s] -- Using std::fstream for NativeFileStream
[   79s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0
[   80s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0 - Failed
[   80s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_1
[   81s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_1 - Success
[   81s] -- Linking c++utilities against library "-lstdc++fs" for std::filesystem support.
```
2021-06-17 16:40:05 +02:00
Martchus 8bda5ce146 Bump patch version 2021-06-17 16:05:43 +02:00
Martchus 95202d059a Fix typo 2021-06-04 16:04:26 +02:00
Martchus 5e1ff7ccb0 Update README
* Mention how to disable `NativeFileStream`
* Update platform-specific notes
2021-05-31 19:56:49 +02:00
Martchus 1ac1104535 Add workaround for Windows-specific console problems
* Allow disabling the hack for creating a console for
  a GUI application via `ENABLE_CONSOLE=0` to workaround
  downsides of this hack (pipes not working, possibly
  spawns an additional console)
* Set the console's character set to UTF-8 by default
  because this actually seems to work now and
  non-ASCII characters are displayed correctly. There
  is still an opt-out via `ENABLE_CP_UTF8=0`.
* Note that with mintty it just works anyways so using
  that terminal emulator is still the best workaround.
2021-05-28 19:15:09 +02:00
Martchus e6e7a63d6a Make DateTime::fromString() cope with 'T' separator 2021-05-24 21:27:47 +02:00
Martchus a116c9e790 Avoid possibility of overflow in DateTime parsing functions
* This is strictly undefined behavior so let's avoid it
* As a side-effect it is now possible to omit the separators in
  DateTime::fromIsoString()
2021-05-24 21:27:18 +02:00
Martchus 2e93882882 Reduce redundant code in stringconversion.h 2021-05-24 19:51:49 +02:00
Martchus 3afed30760 Detect overflow in functions to convert strings to numbers
Otherwise these functions can strictly run into undefined behavior which
should be prevented.
2021-05-24 19:51:49 +02:00
Martchus d5e35e460c Fix a few details in string conversion functions 2021-05-23 19:20:45 +02:00
Martchus 546b1fecb7 Fix parsing ISO timestamp with negative timezone offset and no seconds fraction
See https://github.com/Martchus/syncthingtray/issues/93
2021-05-21 19:40:37 +02:00
Martchus 63955ffcc5 Avoid including ranges header under reflective-rapidjson's generator
This works around errors which Clang 11.1.0 has when parsing this header
from GCC 11.1.0. (Yes, at this point the GCC and Clang versions which are
currently in Arch Linux testing are identical.)
2021-05-16 19:21:58 +02:00
Martchus 7cea979261 Remove obsolete comment about ios_base::failure and new ABI 2021-05-13 16:23:10 +02:00
Martchus 6d5045c2b1 Port away from deprecated WriteCompilerDetectionHeader module 2021-05-13 15:49:53 +02:00
Martchus b22a600e77 Fix broken code in ArgumentParser::printBashCompletion() leading to crashes
See https://github.com/Martchus/cpp-utilities/issues/19#issuecomment-839758443
2021-05-12 17:52:36 +02:00
Martchus f549285fde Fix splitString()/splitStringSimple() for case of empty trailing part 2021-05-11 16:42:28 +02:00
Martchus 0fb533ffc5 Format attempted test file/dir lookups more nicely in the error case 2021-04-06 17:46:15 +02:00