Commit Graph

1200 Commits

Author SHA1 Message Date
Martchus a19ee41a39 Apply cmake-format and clang-format 2023-05-16 21:39:10 +02:00
Martchus 0341316b4b Fix warning from MSVC about data loss 2023-05-10 22:06:59 +02:00
Martchus 0d0685d4c7 Simplify workaround for starting console and CLI-wrapper
* Disable workaround by default; with the CLI-wrapper available it makes no
  sense to run this code unnecassarily when the main executable is invoked
    * Remove check for Mintty; with the workaround disabled by default it
      is no longer necassary to avoid it
* Simplify the CLI-wrapper to rely on main application for enabling UTF-8
  and virtual terminal processing as it relies on it for attaching to the
  parent's console anyways
2023-05-09 00:16:28 +02:00
Martchus c6396f92fc Ignore warnings for use of legacy CRT functions when compiling with MSVC for now
There's no warning about these when compiling for other targets so let's
ignore them for now.
2023-05-07 21:52:06 +02:00
Martchus c60584e122 Allow compilation of Windows resource file when using MSVC as well 2023-05-07 21:34:46 +02:00
Martchus f3cb406ebe Add CLI-wrapper for Windows
Starting the console from a GUI application is not working very
well - so let's just provide a 2nd executable for the CLI. It
will be a simple console application that merely invokes the main
application passing all standard I/O. Unfortunately this does not
mean the existing hacks can be removed. Without them the wrapper
still doesn't get any I/O from the GUI application.
2023-05-07 21:32:21 +02:00
Martchus caace3ac63 Improve workaround for starting console from GUI app
It is still not perfect but now at least:

* Redirections to a file and pipes are no longer broken with `cmd.exe`
* Pipes are no longer broken in PowerShell
* It works at all when using MSVC
* The whole workaround is skipped for Mintty (as it is not needed at all)
* Sending a return key to the terminal in the end has been removed as it
  caused more harm than good in certain terminals and did not work in
  terminals other than `cmd.exe` anyways
2023-05-07 20:39:22 +02:00
Martchus 5e325d0b92 Avoid unqualified call to `std::move` 2023-05-05 01:06:06 +02:00
Martchus 5425488421 Fix preset for debug build with MSVC
* The preset must inherit from "debug" first so the build type is
  not overridden
* Use the debug library of cppunit
* Avoid configuring ccache which is not generally used under
  Windows
2023-05-01 19:25:18 +02:00
Martchus cb5ca77658 Improve test helper for launching an app
* Add helper that allows to specify the exit code (in case a non-zero
  exit code is actually expected)
* Use the proper macros to inspect the status returned by `waitpid()` to
  print/check the exit status correctly
2023-04-29 13:06:31 +02:00
Martchus 93a632e831 Bump minor version 2023-04-29 12:53:46 +02:00
Martchus ad39cbd604 Apply clang-format 2023-04-29 12:53:18 +02:00
Martchus e8b4279062 Don't use sendfile64() if input and output are the same to avoid EBADF
This does not work and leads to sendfile64() running into EBADF ("Bad file
descriptor").
2023-04-23 21:21:32 +02:00
Martchus a55a3604bd Fallback from sendfile64() in case of ENOSYS as well
As suggested on https://man7.org/linux/man-pages/man2/sendfile.2.html.
2023-04-23 21:04:31 +02:00
Martchus da91e54ec7 Disable use of sendfile64() by default
When changing tagparser to actually make use of the overloads
that use sendfile64() it breaks with "Bad file descriptor". So
better disable this until it has been better tested.
2023-04-23 20:51:33 +02:00
Martchus 83025c17a1 Fallback to unoptimized version if sendfile64() fails
It might fail on some filesystems such as `ecryptfs`, see
https://github.com/Martchus/cpp-utilities/issues/24.
2023-04-23 19:38:56 +02:00
Martchus 2467c4f815 Make use of platform-specific APIs for optimizing CopyHelper configurable
There might be unexpected limitations like
https://github.com/Martchus/cpp-utilities/issues/24. To be able to at least
workaround those limitations it makes sense to allow disabling the
optimization completely.
2023-04-23 19:23:47 +02:00
Martchus 10a7e4d814 Bump patch version 2023-04-06 18:09:42 +02:00
Martchus 59896da087
Merge pull request #23 from ahesford/minimalism
Fix use of `sendfile()` on 32-bit systems
2023-04-06 18:06:59 +02:00
Andrew J. Hesford c9131ce6e7 Fix use of `sendfile()` on 32-bit systems 2023-04-06 11:36:06 -04:00
Martchus 4316dfd846 Fix formatting in README 2023-04-04 17:10:34 +02:00
Martchus 873cf513c3 Improve README
* Wrap long lines
* Improve wording
* Mention icon bundling
* Remove obsolete notes
* List requires MSYS2 and VCPKG packages for Windows builds using CMake
  preset
2023-03-30 21:37:51 +02:00
Martchus 48aa1f54e0 Add `FFMPEG_BIN` to Windows preset 2023-03-30 21:33:42 +02:00
Martchus b426443aaf Workaround issues with `win-x64-msvc-static` preset
* Set CXX flags manually to specify the `/MT` flag explicitly; this is
  needed as compilations of moc objects apparently don't pick-up the
  variable `CMAKE_MSVC_RUNTIME_LIBRARY` and instead use what the Qt build
  had used (which breaks the compilation when using a shared Qt build with
  this setup which otherwise prefers static libraries)
* Set build type explicitly to release as otherwise a debug build would be
  made (but we have `win-x64-msvc-static-debug` for that)
* Specify the VCPKG target triplet to prefer static libs
* Disable the Qt Quick GUI for now; otherwise passwordmanager is trying to
  pull-in kirigami
* Remove most hardcoded paths for dependencies; with the correct VCPKG
  target triplet those paths can be auto-detected (except for CppUnit)
2023-03-29 23:40:57 +02:00
Martchus 2a123df86d Avoid use of non-standard escape character to avoid MSVC warning about it 2023-03-26 21:49:54 +02:00
Martchus bcd5816d23 Apply clang-format and cmake-format 2023-03-25 18:52:13 +01:00
Martchus d94e49620d Add paths for Doxygen and clang-format to Windows preset 2023-03-23 21:51:57 +01:00
Martchus c3470d0378 Improve build instructions
* Move packaging info into its own section
* Link build instructions for Tag Editor as well as they differ
  slightly from Syncthing Tray
* Use consistent path separator for Windows-specific variables
2023-03-20 23:01:00 +01:00
Martchus 9bd7dbc41c Use Ninja in build example 2023-03-20 22:49:26 +01:00
Martchus 9b1a7b3bf4 Fix includes in `copy.h` when using `sendfile()` 2023-03-19 20:09:14 +01:00
Martchus ec891b48f6 Use `sendfile()` to speed up copying 2023-03-19 20:02:32 +01:00
Martchus 7a5a02976a Fix symbol visibility when building Android apps 2023-03-19 20:02:32 +01:00
Martchus 6e28bec4c5 Add REALPATH_BIN to Windows-preset for CMake bug workaround 2023-03-16 01:02:49 +01:00
Martchus 65b86d71f6 Set QT_ANDROID_VERSION_NAME for Android target 2023-03-11 19:59:09 +01:00
Martchus ab298b200f Apply clang-format 2023-03-11 17:05:08 +01:00
Martchus 2a9949ce77 Tweak app target creation for Android deployment via Qt 6 helpers 2023-03-11 17:04:41 +01:00
Martchus e2593cea2a Bump minor version 2023-03-11 17:00:04 +01:00
Martchus 6ec77a1d1c Add `extractNativePath()` as counterpart to `makeNativePath()` 2023-03-06 22:17:44 +01:00
Martchus 283c416a59 Add preset for building on Windows with MSVC 2023-03-06 22:17:37 +01:00
Martchus 4aea7f5a57 Set `KF_PACKAGE_PREFIX` as well when building against Qt 6 2023-03-05 12:26:33 +01:00
Martchus 169756fce4 Fix loop-condition in `iotests.cpp` 2023-02-28 21:18:15 +01:00
Martchus 30819d9e85 Improve condition for use of `pubsetbuf`
Using this function like this seems only be possible with `libstdc++`. The
standard lib of MSVC and Clang both don't support this (so it is not just
MSVC and thus not Windows-specific).
2023-02-28 21:17:33 +01:00
Martchus 78d57902a7 Workaround MSVC-specific issues in testsuite so tests pass with MSVC 2023-02-28 00:07:56 +01:00
Martchus 2b6f26895d Support multiple source directories in `srcdirref` file
* Locate test files in all source directories specified in `srcdirref`
* Allow overriding contents of `srcdirref` so the directory of another
  component (within the same repository) can be appended to share testfiles
2023-02-27 18:29:31 +01:00
Martchus a703813b4c Mark helper functions of `testutils.cpp` as static; they're not used elsewhere 2023-02-27 18:29:21 +01:00
Martchus 07e9546855 Avoid relying on compiler optimizations for binary conversions
* Add/update binary conversion functions to use `std::memcopy`
* Only GCC could actually optimize the custom code using bit operations
    * Clang could only optimize the `getBytes()` functions
    * MSVC could not optimize any of the functions
* The to…Int…() functions cannot be updated as they are `constexpr` (and
  thus `std::memcopy` and `reinterpret_cast` cannot be used). So they stay
  as-is and `toInt()` has been added instead
* The `BinaryReader` class has been updated to use the new `toInt()`
  function
2023-02-05 21:29:22 +01:00
Martchus 147d36a578 Improve messages of conversion tests 2023-02-05 21:21:26 +01:00
Martchus 31f369d051 Add signed versions of `swapOrder()` functions 2023-02-05 21:20:53 +01:00
Martchus 66621d757b Bump minor release 2023-02-05 20:40:24 +01:00
Martchus 3b2615fa62 Move `BE`/`LE` namespaces to the end so these functions can use previous helpers 2023-02-05 20:17:32 +01:00