summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Prepare v2.3.5.Donovan Baarda2023-02-191-1/+1
| | | | Prepare for development of the next v2.3.5 release.
* Fix #248 by putting `#include "config.h"` in most src/*.c files. (#249)Donovan Baarda2023-02-191-4/+3
| | | | | | | | | | | | | | | | | | * Fix #248 by putting `#include "config.h"` in all src/*.c files. The iwyu tool doesn't handle `config.h` files well, and these includes were incorrectly removed, which breaks things on some platforms. Add them back to most `src/*.c` files with `/* IWYU pragma: keep */` to make iwyu ignore them. We skip `src/hashtable.c` because it is a standalone tool that is platform independent. Also add `/* IWYU pragma: keep */` to includes in `src/fileutil.c` that are needed on some platforms but not others. This means we can remove the special exemptions to skip this file for the `iwyu` and `iwyu-fix` targets in `CMakeLists.txt`. Add some explicit typecasts to `rollsum.[ch]` and `patch.c` to silence warnings on windows. Update NEWS.md for `config.h` include fixes and added typecasts.
* Prepare for development of the next v2.3.4 release.Donovan Baarda2023-02-161-1/+1
|
* Update github actions and fix `iwyu` build target. (#243)Donovan Baarda2023-02-011-1/+2
| | | | | | | | | | | | | | | | | | | | | * Update github actions checkout and upload-artifact to v3. The old v2 versions of these github actions now produce errors warning you need to update them. * Fix lint.yml remove install of old libclang-common-9-dev package. The iwyu package dependencies have been fixed, and this old package doesn't exist any more. * Run `make iwyu-fix` to fix includes for `tests/rabinkarp_perf.c`. * Change the `iwyu` build target to use clang output format. This format is much more compact and easier to read. * Make `iwyu` build target trim noisy "note:" output and ignore fileutil.c. * Update NEWS.md for all #243 changes.
* Change doc target to run in `CMAKE_CURRENT_SOURCE_DIR`.Donovan Baarda2021-08-211-1/+1
| | | | | | | | Make the doc target run in CMAKE_CURRENT_SOURCE_DIR and change `Doxyfile.in` to generate output into `OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@`. This ensures consistent doc filenames and references when using different build directorys, without leaking the full path of where it was built. See
* Rename src/config.h.cmake -> src/config.h.in.Donovan Baarda2021-08-201-1/+1
| | | | This makes the name more consistent with other cmake template files.
* Add iwyu-fix build target to fix includes.Donovan Baarda2021-08-201-1/+9
| | | | | This uses iwyu_tool output fed to `fix_include --noblank_lines` and excludes fileutil.c which gets messed up by this.
* Slightly tidy lint.yml and CMakeLists.txt.Donovan Baarda2021-08-191-1/+1
|
* Add iwyu build target for running iwyu_tool checks.Donovan Baarda2021-08-191-0/+7
|
* Add clang-tidy target to CMakeLists.txt.Donovan Baarda2021-08-181-0/+10
| | | | | This is a "linter" that checks code for errors, taken from PR #222 by riszotto.
* Merge pull request #226 from dbaarda/dev/cmake1Donovan Baarda2021-08-121-0/+4
|\ | | | | Tidy the cmake config and add better build configuration support.
| * Add BuildType.cmake for managing CMAKE_BUILD_TYPE better.Donovan Baarda2021-08-101-0/+4
| | | | | | | | | | | | | | | | | | | | This is an idea taken from the following post; https://blog.kitware.com/cmake-and-the-default-build-type/ It sets the default build type to Debug for git clone, otherwise the default is Release. It also sets possible values for the cmake-gui or ccmake. It works with multi-config generators and respects values set on the cmdline.
* | Fix windows tests by removing quotes around "bash -e".Donovan Baarda2021-08-121-1/+1
| | | | | | | | | | Putting the quotes around it makes it try to execute a command called "bash -e" instead of seeing the `-e` as another argument.
* | Add bash `-e` argument when running tests on Windows.Donovan Baarda2021-08-121-1/+1
| | | | | | | | | | This makes the bash cmdline arguments consistent between running on Windows and on other platforms using the `#!/bin/sh -e`.
* | Rename tests/rdiff_bad_option.sh to tests/rdiff_bad_option.test.Donovan Baarda2021-08-121-1/+1
|/ | | | This makes this test consistent with the other integration test scripts.
* Change cmake option ENABLE_TRACE default to ON for Debug builds.Donovan Baarda2021-08-101-1/+6
|
* Fix bash test scripts to work on Windows.Donovan Baarda2021-08-091-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | In CMakeLists.txt, explicity execute scripts with bash on WIN32 platforms (it doesn't understand `#!/bin/sh`). Execute test scripts with the full rdiff path expanded from `$<TARGET_FILE:rdiff>` as the first argument instead of `${CMAKE_CURRENT_BINARY_DIR}`. Update tests/testcommon.sh to set `RDIFF` instead of `bindir` from $1, and use `${RDIFF}` as the rdiff binary in all tests. Change rdiff_bad_option.sh to use testcommon.sh and use $RDIFF to execute the rdiff binary. Make it use the testcommon.sh created tmpdir and use set -x to trace only the interesting cmds instead of the whole script. The $<TARGET_FILE:rdiff> is always the full path of the generated binary, including the .exe extension on Windows. The ${CMAKE_CURRENT_BINARY_DIR} is usually the directory where the generated binary is, but multi-configuration generators (Visual Studio, Ninja) add a per-build-type directory (Release, Debug, etc) and put them in there. This means ${CMAKE_CURRENT_BINARY_DIR} doesn't give you an easy way to find the binary, and doesn't tell you if it has a .exe extension. Passing in the full binary path solves all these problems. Fortunately the tests only need the rdiff binary.
* cmake: fix warning for later CMake versionsLaszlo Nagy2021-08-081-1/+1
|
* Prepare for development of the next v2.3.3 release.Donovan Baarda2021-04-101-1/+1
|
* Use `-Wconversion -Wno-sign-conversion` for clang only.Donovan Baarda2020-06-041-2/+4
|
* Use `-Wconversion -Wno-sign-conversion` when compiling with gcc or clang.Donovan Baarda2020-06-041-2/+2
|
* Make fileutil.c include io.h if it exists and prefer _fileno().Donovan Baarda2020-06-041-0/+1
| | | | | On window io.h is needed for _setmode(), and it has both fileno() and _fileno() but warns that fileno() is deprecated.
* Turn of posix warnings when compiling with MSVC.Donovan Baarda2020-06-041-1/+4
| | | | | | | | Add `/D_CRT_SECURE_NO_WARNINGS` to MSVC CFLAGS to turn off warnings about posix functions. Also add optional commented out `-Wconversion` and `-Wno-sign-conversion` flags for gcc and clang for easy experimenting with more warnings.
* Compile netint_test with `-DLIBRSYNC_STATIC_DEFINE`.Donovan Baarda2020-06-031-0/+1
| | | | | This ensures that Windows compiles don't complain about export stuff when compiling this test.
* Remove stream.c and move functionality into tube.cDonovan Baarda2020-06-021-2/+1
| | | | | | | | This closes out a TODO for this. Move big description comment from stream.c to stream.h. Move rs_buffers_copy() from stream.c to rs_tube_copy_from_stream() in tube.c. Make rs_tube_catchup_write()'s trace output a little more consistent. Make rs_tube_copy_from_scoop() do nothing when there's no input our output space.
* Pass `-C Debug` to ctest instead of `--config Debug` to cmake.Donovan Baarda2020-06-021-1/+1
| | | | | | It seems passing `--config Debug` to cmake in .travis.yml didn't work. Instead we need to pass `-C Debug` to ctest in CMakeLists.txt to make it work on Windows.
* Comment out breaking `-Wno-format` when building on Windows.Donovan Baarda2020-06-011-1/+1
|
* Prepare for development of the next v2.3.2 release.Donovan Baarda2020-05-191-1/+1
|
* Fix cmake/FindPOPT.cmake use PkgConfig correctly.Donovan Baarda2020-05-191-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the cmake popt detection on (at least) FreeBSD. It mostly worked by accident on other platforms like Debian because of standardized install locations aligning with our miss-used output vars. In CMakeLists.txt bump cmake_minimum_required to 3.6 for a working version of pkg_search_module() with IMPORTED_TARGET support. The version on our travis xenial test platform is 3.12.4, so 3.6 is rather old. Fix BZIP2 detection to use the correct BZIP2_INCLUDE_DIRS var. Add POPT status messages to match other find_package() handling. Remove redundant "Found..." messages from all find_package() handling. In cmake/FindPOPT.cmake use pkg_search_module() IMPORTED_TARGET support to create a PkgConfig::POPT target and use it, following instructions found here; https://stackoverflow.com/questions/29191855/what-is-the-proper-way-to-use-pkg-config-from-cmake Follow a pattern from official FindPackage modules of using cached vars POPT_LIBRARY_RELEASE/POPT_IMPORT_DIR to set uncached vars POPT_LIBRARIES/POPT_IMPORT_DIRS. This makes it behave almost exactly like offical FindPackage modules. In cmake/Findlibb2.cmake update it to also use the more standard cached/uncached vars pattern.
* Add rabinkarp_perf.c test and optimize rabinkarp.c.Donovan Baarda2020-04-161-0/+2
| | | | | A lot of testing of many different variants of the loop unrolling seems to indicate this is the best variant of the loop-unrolling.
* Initial tests with unrolling rabinkarp_update() as a function.Donovan Baarda2020-04-151-3/+4
| | | | This adds rabinkarp.c copying rollsum.c's unrolled loop idea.
* Prepare for development of the next v2.3.1 release.Donovan Baarda2020-04-071-1/+1
|
* Update NEWS.md and bump minor version to 2.3.0.Donovan Baarda2020-04-071-2/+2
| | | | | | | In NEWS.md update with all changes applied so far. In CMakeLists.txt and librsync.spec bump the minor version to 2.3.0 to reflect addional rs_sig_args() and strong_len=-1 support.
* Turn off format warnings for WIN32 only.Donovan Baarda2020-02-021-6/+7
| | | This reverts the last commit and instead turns of warnings for WIN32 only.
* Assume "%zu" support when cross-compiling.Donovan Baarda2020-01-101-6/+6
| | | Instead of suppressing warnings for all platforms about format strings with `-Wno-format` because minGW complains about using `%I64`, assume that any compiler advanced enough to cross-compile is also C99 compliant and supports `%zu`.
* fix various warningsAndrew Sun2020-01-081-1/+1
|
* Tidy netint.[ch] and add tests.Donovan Baarda2019-12-031-3/+13
| | | | | | | | | Add tests/netint_test.c and CMakeLists.txt changes to test rs_int_len(). In netint.[ch] replace runtime checks for invalid arguments with assert() statements and tidy the argument names, variable names, and ordering. Replace `unsigned char` arguments with `rs_byte_t`. Add an assert to rs_int_len() to require the argument is positive.
* Reorder __func__ and __FUNCTION__ cmakedefines and remove STDC_HEADERS.Donovan Baarda2019-11-261-3/+0
| | | | | This makes the cmakedefines in src/config.h.cmake reflect the order of checks in CMakeLists.txt. It also removes the obsolete STDC_HEADERS define.
* Remove cmake HAVE_* checks for unused and/or standard C99 features.Donovan Baarda2019-11-251-14/+2
| | | | | We never used these HAVE_* defines and just assumed the features existed anyway. Also put the checks and cmakedefines into the same order.
* Remove unused support for nonstandard program_invocation_short_name.Donovan Baarda2019-11-251-1/+0
| | | | | | | In CMakeLists.txt and src/config.h.cmake remove HAVE_PROGRAM_INVOCATION_NAME. In src/trace.c remove conditional use of program_invocation_short_name. This was unused because we never checked/set HAVE_PROGRAM_INVOCATION_NAME.
* Remove cmake support for unused features.Donovan Baarda2019-11-251-2/+0
| | | | | | | | | | | | In CMakeList.txt and src/config.h.cmake remove support for unused alloca function, including HAVE_ALLOCA_H, HAVE_ALLOCA, CRAY_STACKSEG_END, C_ALLOCA, and STACK_DIRECTION. In src/config.h.cmake remove unused and unchecked or not working cmakedefines for HAVE_LIBBZ2, HAVE_LIBPOPT, HAVE_LIBZ, HAVE_SNPRINTF, HAVE_VARARG_MACROS, HAVE_VSNPRINTF, HAVE__SNPRINTF, and HAVE__VSNPRINTF. The HAVE_LIB* ones were just broken and unused. The others were unchecked, unused, and for standard C99 features we assume exist in the code.
* Make src/trace.[ch] C99 compliant.Donovan Baarda2019-11-251-1/+4
| | | | | | | | | | | | | In CMakeLists.txt add "-pedantic" to CMAKE_C_FLAGS for gcc/clang to enable stricter C99 compiling. Add checks for symbols __func__ and __FUNCTION__. In src/config.h.cmake add cmakedefine's for HAVE___FUNC__ and HAVE___FUNCTION__. Remove unimplemented FIXME defines for C99 standards const, off_t, and size_t. In src/trace.[ch] remove all support for compilers without C99's macro varargs support. Add support for platforms with __FUNCTION__ instead of __func__. Use C99 macro varargs instead of GNU named varargs and simplify macros.
* CMakeLists: fix build with old compilersPierre-Jean Texier2019-11-241-1/+1
| | | | | | | | | | | | | | | The librsync code uses some C99 constructs, but old compilers such as gcc 4.7 don't default to -std=c99. This commit makes sure librsync is built with -std=c99. Fixes: src/rabinkarp.h:82:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (size_t i = len; i; i--) { ^ src/rabinkarp.h:82:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
* Prepare for development of the next v2.2.2 librsync release.Donovan Baarda2019-10-171-1/+1
|
* Update for unreleased version to v2.2.1.Donovan Baarda2019-10-121-1/+1
| | | | | Add Unreleased v2.2.1 entry in NEWS.md. Update CMakeLists.txt and librsync.spec for v2.2.1.
* Prepare release v2.2.0.Donovan Baarda2019-10-121-2/+2
| | | | | | Update version to 2.2.0 in CMakeLists.txt, NEWS.md, and librsync.spec. Add NEWS.md entries for version bump and MSVS 2019 fixes. Add changelog entry to librsync.spec.
* Add cmake BUILD_SHARED_LIBS option for static library support.Donovan Baarda2019-10-021-3/+11
| | | | | BUILD_SHARED_LIBS defaults to ON, and can be set to OFF using `ccmake .` to build librsync as a static library.
* Simplify HAVE_PRINTF_Z logic using elseif clause.Donovan Baarda2019-09-171-10/+8
|
* Tidy logic for WIN32 "%zu" checking.Donovan Baarda2019-09-171-13/+10
| | | Re-arrange the logic to be a little less convoluted, and add comments explaining why it's done that way.
* disable HAVE_PRINTF_Z when directly compiling on WindowsAndrew Sun2019-09-151-2/+7
|