Commit Graph

1062 Commits

Author SHA1 Message Date
Martchus b9c8f795d4 Add preset for building on Windows with MSVC 2023-03-05 12:27:06 +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
Martchus b3fd365502 Use `std::byteswap()` when compiling in C++23 mode 2023-02-05 20:15:29 +01:00
Martchus 8588c17df3 Remove wrong includes in `binaryconversionprivate.h`
This header is not meant to be self-contained and must not include any
other headers.
2023-02-05 19:57:36 +01:00
Martchus 7d6fc9721a Apply clang-format/cmake-format 2023-02-03 13:31:18 +01:00
Martchus be6626f6a6 Fix using percentage operators of `stringbuilder.h` with MSVC 2023-02-01 00:43:53 +01:00
Martchus 024865cc44 Fix building conversion tests with MSVC 2023-02-01 00:42:44 +01:00
Martchus b9b8bfc62a Fix and improve code for finding CppUnit
* Remove `FORCE` in initialization of cache variables as this makes the
  library/include dir effectively *not* configurable
* Try using `find_package()` as the vcpkg package provides a CMake module
2023-01-31 22:37:06 +01:00
Martchus 25e4eebb64 Avoid MSVC warning about possible overflow 2023-01-31 22:37:06 +01:00
Martchus 4d96a82ed9 Workaround unfortunate macro definition in `windows.h` 2023-01-31 22:37:06 +01:00
Martchus a5a33bbcef Add missing include for `std::tuple` to `argumentparser.h` 2023-01-31 22:37:06 +01:00
Martchus da830dcef5 Apply clang-format and cmake-format 2023-01-28 20:20:47 +01:00
Martchus 3a4d71ef5c Avoid unqualified call to `std::move` 2023-01-28 20:20:30 +01:00
Martchus 53ce099bf9 Apply clang-format 2023-01-28 18:49:54 +01:00
Martchus d1eeae83c6 Fix includes for command-line utilities
Most importantly, import `io.h` under Windows as it is required for using
`_open_osfhandle`.
2023-01-26 22:26:42 +01:00
Martchus b6fa13f8dd Use C++ 20 when compiling with MSVC as it requires it for designated initializers 2023-01-26 22:23:46 +01:00
Martchus 38fa3512fd Disable assert for argument name for MSVC to avoid compilation error
Not sure what MSVC complains about here exactly so let's just disable this
code as it is only for debugging anyways.
2023-01-26 22:23:12 +01:00
Martchus d4fbe5f43d Use `std::` consistently in `convertMultiByteToWide()` 2023-01-26 22:20:59 +01:00
Martchus 16f17fb9de Make feature detection for thead local work with MSVC 2023-01-26 22:20:20 +01:00
Martchus e02fed2b57 Add directories of Visual Studio to `.gitignore` 2023-01-26 22:18:43 +01:00
Martchus 16782fc547 Improve formatting in `.gitignore` 2023-01-26 22:18:22 +01:00
Martchus 81618a3468 Expose package version via `use_package` function 2023-01-22 23:01:10 +01:00
Martchus bdc96ade41 Update copyright notice 2023-01-17 18:34:13 +01:00
Martchus 23ca57740b Apply cmake-format 2022-12-24 23:15:47 +01:00
Martchus c48816b243 Move CMake code for enabling warnings into separate module and function 2022-12-24 23:15:24 +01:00
Martchus d9eb99fca1 Allow to keep CMake's CXX_STANDARD property empty
This can be useful to e.g. specify the standard manually or to just stick
to the compiler's default.
2022-12-23 20:52:00 +01:00
Martchus 1aba9f5f6f Allow setting Windows/MacOS icon paths to avoid conversion
This makes it possible to have an own version of the icon for those
platforms instead of relying on an automatic conversion from the generic
PNG icon.
2022-12-22 23:28:05 +01:00
Martchus d8c38699ba Avoid warning about unqualified std cast 2022-11-04 16:50:13 +01:00
Martchus a9ea4f4f47 Bump patch version 2022-11-04 16:49:25 +01:00
Martchus 59217e9985 Fix typo 2022-10-30 21:36:43 +01:00
Martchus 7f782cdb28 Add CMake presets 2022-10-30 21:36:08 +01:00
Martchus 913b6e7d65 Apply CMake format 2022-10-16 15:04:52 +02:00
Martchus e502269d50 Run cmake-format on tests specified via `QT_TESTS` variable 2022-10-16 15:04:38 +02:00
Martchus 3f072549a6 Detect whether GPL license version is "-or-later" automatically 2022-10-13 00:03:04 +02:00
Martchus aa31d441d7 Avoid guessing release data for AppStream file, rely on explicit meta-data 2022-10-12 22:55:56 +02:00
Martchus 804852b95e Do not exclude appstream validation from checks as errors should be handled 2022-10-11 21:03:17 +02:00
Martchus d05677e3b5 Prevent AppStream validation error `asv-release-time-missing`
* Avoid hard-coding and additional steps in the release workflow by simply
  considering the day of the last modification the release date
* See https://github.com/Martchus/syncthingtray/issues/158
2022-10-11 21:00:16 +02:00
Martchus da431580d4 Prevent AppStream validation error `asv-cid-desktopapp-is-not-rdns`
See https://github.com/Martchus/syncthingtray/issues/158
2022-10-11 20:58:21 +02:00
Martchus fdd6af1b2c Document appstreamcli dependency 2022-10-11 19:29:23 +02:00
Martchus 4a7a9ec32d Add build system check to validate appstream files
* Exclude new tests from `check` target for now as they are currently
  failing
* See https://github.com/Martchus/syncthingtray/issues/158
2022-10-11 19:25:17 +02:00