4255 Commits

Author SHA1 Message Date
Cosmin Truta
671661849a build: Move scripts/*.m4 to scripts/autoconf/
Move all Autoconf macro files (except for those that need to be in
the top-level directory) to their own subdirectory scripts/autoconf/

In this commit, we introduce a better way to organize the scripts dir,
and we make a better separation between the build scripts under the
libpng license vs. the build scripts that fall under other licenses.

Please see scripts/autoconf/README.md for more information.
2024-01-22 15:16:10 +02:00
Cosmin Truta
438a518611 Update the main AUTHORS file 2024-01-20 19:09:38 +02:00
John Bowler
8fb49b8b94 Relax pngtest-all message testing
Previously the 'make check' test pngtest-all looked for given messages
at EOL.  The match failed with Windows/MSYS2 because of the Windows
<cr><lf> line endings output by pngtest.  This changes the test to look
for the message anywhere in a line; this might give false matches but
the specific messages being searched for are not likely to cause this
problem.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-19 15:31:53 -08:00
John Bowler
144b348e07 Use --xfail for Adler32 check in pngtest-all
The test always failed on systems with no support for zlib
inflateValidate and on systems where the png_set_option setting was
disabled, however pngtest-all succeeded because the failure was ignored.
The latter is now fixed so the badadler.png check needs to use --xfail,
not --relaxed.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-19 11:10:00 -08:00
John Bowler
1a0d7a7481 Correct regression-palette-8.png
This corrects contrib/testpngs/badpal/regression-palette-8.png.  Despite
the comment in commit da109d3e the file checked in had 255 PLTE entries
so failed to perform the regression test.  This version of the PNG has
254 entries.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-19 08:55:56 -08:00
Adam Richter
866fdf6f8f Fix an off-by-one error in png_do_check_palette_indexes
The last byte of each row was ignored in a function that was executed
under the build flags `PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED` and
`PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED`.

This is a revert of a change previously applied in libpng-1.6.33beta01.
See SourceForge bug #269 at https://sourceforge.net/p/libpng/bugs/269/

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-19 17:45:27 +02:00
John Bowler
6f8257e437 tests/pngtest-all: detect failures add tests
This change is only verifiable in configure builds; cmake only executes
the basic test.

The previous version of tests/pngtest-all only returned the status code
of the final test.  Apparently it could never fail.  This adds checking
of all return status codes.

The change also adds a basic approach for regression testing with PNGs
that should fail a test; --strict ensures that PNGs which are valid do
not start to be reported as erroneous, this is the inverse.

At present the code (minimal traditional Bourne shell) only tests the
palette index checking code, a potentially important check if apps rely
on it.

The changes have been tested using the configure build both with a
regression which causes the libpng checking to cease to work and with a
corrected (reverted regression).  The regression test verifies that the
intended check works as expected.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-18 17:36:59 -08:00
John Bowler
269b753496 Do not build unused Adler32 code
This removes the default build of an undocumented feature to disable
Adler32 checksums on those systems where it was the default.

The PR is motived by github #187 however it fixes a much more general
problem (#187 is limited to an issue where libpng "crashes" on some
manufacturer systems).  The fix is based on a suggestion by @sgowdev who
is the originator of the issue.

When libpng disables the checking of Adler32 checksums it does so by an
undocumented and therefore possibly unsupported call to a zlib function
which does not exist in some versions of zlib.

Fortunately libpng only does this if the caller of libpng explicitly
asks for it to happen.  Unfortunately the call to the undocumented
function is still in the compiled and built libpng and this means that
on some systems (as identified in #187) libpng can fail to load or maybe
even crash.

The libpng authors are currently unaware of any program or system that
uses this feature and none has been identified by the contributors to

In this fix an option is added to *enable* the code so that by default
the code is *disabled* - this is a simple generalization of the
suggestion by @sgowdev.

BENEFITS: the problem is eliminated, users of the functionality, if any,
are idenfified, the functionality can be implemented correctly in the
future or it can be removed.  Hardly anyone complains.

COSTS: someone will complain that they have to enable an option in a
libpng build to use a feature that never worked consistently in the
first place.

This patch has been tested both with the option enabled and with it
disabled via pngusr.dfa.  Tests, checks pass with cmake and configure,
make distcheck passes on configure.

Reported-by: Stephen Gowen <dev.sgowen@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-18 23:57:06 +02:00
John Bowler
2b814cde29 Regression test for off-by-one palette check error
This adds a file to regression-test the previously introduced off-by-one
error in the check on read for a colormapped PNG with an out-of-range
index (equal or greater than the length of the PLTE).

Previous tests covered all cases except the 8-bit palette case; the
"small" test file contains the "bad" entry at index 254, not 255 so it
passes even if the final byte is not checked.  The new file has the
erroneous entry in the last byte.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-18 23:17:51 +02:00
Zixu Wang
893b8113f0 Fix unused platform check and configuration for macOS
In a similar manner as zlib (https://github.com/madler/zlib/pull/895),
libpng contains a header configuration that's no longer valid and
hasn't been exercised for the macOS target.

- The target OS conditional macros are misused. Specifically
  `TARGET_OS_MAC` covers all Apple targets, including iOS, and it
  should not be checked with `#if defined` as they would always be
  defined (to either 1 or 0) on Apple platforms.
- `#include <fp.h>` no longer works for the macOS target and results
  in a compilation failure. macOS ships all required functions in
  `math.h`, and clients should use `math.h` instead.

This problem has not been noticed until a recent extension in clang
(https://github.com/llvm/llvm-project/pull/74676) exposed the issue
and broke libpng builds on Apple platforms. The failure can be
reproduced now by adding `#include <TargetConditionals.h>` before the
block.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-18 22:24:30 +02:00
Cosmin Truta
7ec2bd28c7 Update the main Authors file 2024-01-18 18:13:38 +02:00
gxw
70d10da35c MIPS: Fixed undefined MSA interfaces
When compiling on the MIPS platform using the following command:
./configure --enable-hardware-optimizations && make
The options '-mmsa -mfp64' are not being passed.
PNG_MIPS_MSA_IMPLEMENTATION is defined as 2, leading to
the initialization of unimplemented MSA interfaces.
2024-01-18 18:13:23 +02:00
gxw
064f992187 Loongson: Fixed compilation warnings for undefined macros. 2024-01-18 17:58:38 +02:00
gxw
46f1106a3f Loongson-mips: Fixed typo 2024-01-18 10:24:57 +08:00
Cosmin Truta
a7fe3414e5 mips: Wrap up the MIPS/Loongson port and acknowledge the contributors
Completion of this port required a rerun of `./autogen.sh --maintainer`
followed by a rebuild of scripts/pnglibconf.h.prebuilt.
2024-01-17 23:24:05 +02:00
gxw
ce4b632dd7 Optimize png16 with loongson mmi for 64-bit os 2024-01-17 22:46:16 +02:00
jinbo
6b0d1bd75b Add loongarch support and LSX SIMD optimizations
Enable LSX by default:
    ./configure && make

Disable LSX:
    ./configure --enable-loongarch-lsx=no && make

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-17 22:42:02 +02:00
Cosmin Truta
2a4f0f5aee De-volatilize the internal implementation of png_safe_execute
`png_safe_execute` called `setjmp` in a context where the result was
undefined (an assignment statement). This corrects the code and removes
volatile statements that were introduced previously to quell warnings
from earlier versions of GCC.

Co-authored-by: John Bowler <jbowler@acm.org>
2024-01-17 18:06:47 +02:00
Cosmin Truta
7dacc4d5aa Rewrite various initializations for the benefit of various compilers
Mark the initialization of `png_signature[]` as static const inside the
function `png_sig_cmp`. This might be helpful to optimizing compilers.

Initialize the arrays `number_buf[]`, `digits[]` and `buffer[]` inside
the functions `png_convert_to_rfc1123_buffer`, `png_ascii_from_fixed`,
`png_warning_parameter_unsigned` and `png_warning_parameter_signed`.
Although these initializations are redundant, compilers such as gcc-13
fail to see the redundancy.
2024-01-17 16:59:38 +02:00
John Bowler
da109d3e6e Improve test coverage with a "correctly" damaged palette index test
The PNG IDAT did not include a '255' entry, the highest entry is '254',
this corrects the test PNG to have a palette with only 254 entries so
that it triggers the palette index checks.

Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-17 12:43:31 +02:00
John Bowler
f9348b77da write palette check corrections
The write palette check is off-by-one when checking the maximum palette
index against the number of entries however, because of the
implementation, the simple correction would fail if no palette check had
been performed (for example for a non-palette image).  This corrects
both errors so that the code outputs a warning (but not an error) if a
user of libpng writes an image with a PLTE which is one entry short.

The write palette check can be turned off on colour type 3 images
(colour mapping images) but this is done by setting the 'maximum'
palette index in the image to (-1).  The ammended code works because it
only executes for paletted images, it is dependent on palette checks
being compiled in and they will always be checked unless the stored
'max' value is less than 0.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-16 16:15:23 -08:00
John Bowler
2ea11e2235 Palette index checking fixes
The palette index checking function is called by default but only if
some *other* transformation is happening.  This makes the 'get palette
max' public API disfunctional (sometimes it works, sometimes it returns
0) and causes the supposed default behaviour of checking the palette
index only to work sometimes.  It works in pngtest, it doesn't work in
pngcp.

The check in pngread also has an off-by-one error; the number recorded
is the highest index found so it should be checked to ensure that it is
less than the palette length but it was checked for being greater.

The pull request includes a set of 8 files which all have the full range
of possible indices including one (the highest) which is invalid because
the PLTE chunk is one short of the maximum for each bit depth.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-16 14:59:02 -08:00
John Bowler
b60316f4ee Remove GCC7.1 arithmetic overflow fixup
This removes pragmas and the controlling code that quelled warnings
generated by GCC7.1 (only) with -Wstrict-overflow=3 and possibly other
levels.  Tested with GCC13.2, GCC7.1 is no longer the current version of
GCC7 (GCC7.5) and GCC7.1 was replaced by GCC7.2 on August 14, 2017.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-15 21:42:05 +02:00
John Bowler
050ce505e4 pngfix: del workround for GCC7.1 -Wstrict-overflow
Previously pngfix had been made warning-free in GCC7.1 by marking auto
variables (volatile).  This prevented the arithmetic optimizations which
caused warnings from GCC7.1 with higher values -Wstrict-overflow=<n>

GCC has moved on a lot since 7.1 and pngfix.c now compiles with just one
warning using -Wstrict-overflow=5.  The change includes a change to make
this go away by performing the rearrangement GCC was using in the code:

   i == ndigits-1

becomes:

   i+1 == ndigits

i is initialized to ndigits and has been decremented at least once so
this is fine.

Test, configure:

  CFLAGS="-Wall -Wextra -Wno-maybe-uninitialized -Wstrict-overflow=5" \
    ../configure --enable-werror
  make
  make cehck

Test, cmake:

  cmake ..
  make
  make test

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-15 09:50:24 -08:00
John Bowler
2a23247420 pngcp: remove GNU setjmp warning workround
Prior versons of the GCC warned about the 'dest' parameter of
contrib/tools/pngcp.c not being volatile, which isn't necessary because
it isn't modified.  This removes the GCC specific fixup.

The function which calls setjmp, cppng() also relied on undefined
behavior because it assigned the result of setjmp() to a variable; this
is not one of the four uses of setjmp permitted by ANSI-C.  This passes
the result previously returned by longjmp via (struct display).  It's
very very unlikely that any compiler could have got the code wrong but
it is technically undefined.
2024-01-14 15:47:20 -08:00
Cosmin Truta
6b241f3786 Do not rely on INT_MAX in png.h
At a certain step in the configuration process, `gcc -Wundef`
complained about using `INT_MAX` without a definition in png.h,
which is easily fixable with an include.

We would rather not add any extra dependencies to png.h, however,
so we use some unsigned int arithmetic magic instead.
2024-01-12 01:12:08 +02:00
Cosmin Truta
b3521c60af pngminus: Delete the incomplete output files upon premature termination
Defer the program termination on error until all files are closed and
(if applicable) all incompletely-written output files are deleted.

In addition, perform the following maintenance tasks:
 * Rename and document the internal helpers used by the functions
   `png2pnm` and `pnm2png`.
 * Unset the executable permission bits for the *.bat test programs.
2024-01-09 18:54:02 +02:00
Cosmin Truta
6beae586d6 pngminus: Expect all image transformations to be available in libpng
The pngminus programs use several PNG image transformations:
`png_set_expand`, `png_set_expand_1_2_4_to_8`, etc. (in png2pnm.c);
`png_set_packing`, `png_set_invert_mono`, etc. (in pnm2png.c).
The availability of all of these transformations in libpng is now
required at compile time.

On the topic of transformations, apply an unrelated fix to the use
of `png_set_gamma`.
2024-01-09 00:33:39 +02:00
Cosmin Truta
bdbbcaa457 pngminus: Improve and modernize the PNG processing
Improve and modernize png2pnm.c:

 * Remove the explicit reading of the input PNG file signature.
   Libpng is now able to read it, check it, and issue an appropriate
   error message in case of magic number mismatch or file corruption.
   (See the function `png_read_sig`.)

 * Remove the explicit allocation and dealocation of the image data.
   Libpng is now able to manage all the image data automatically.
   (See the function `png_read_png`.)

 * Specify the needed image transformations without a-priori checking
   the image type for applicability.

 * Use the `png_set_expand_gray_1_2_4_to_8` transformation.
   Since libpng version 1.2.9, this transformation (if needed) must
   be enabled separately from `png_set_expand`.

Improve and modernize pnm2png.c:

 * Modify the allocation of image data, in order to match libpng's
   internal allocation model.

 * Transfer the ownership of the image data from the `pnm2png` function
   to libpng, which will manage and dealocate it at the right time.
   (See the functions `png_set_image_rows` and `png_data_freer`.)

Refactor, clean up, etc.
2024-01-08 20:31:18 +02:00
Cosmin Truta
abb8d4a71f pngminus: Fix and improve the PNM processing
Improve png2pnm.c:

 * Add support for writing 16-bit raw PNM image files.

Fix and improve pnm2png.c:

 * Add support for reading 16-bit raw PNM image files.

 * Fix the parsing of arbitrarily long numeric strings.
   In the parsing of PNM tokens, we can and we should avoid storing
   more than one leading '0' in the token buffer. All valid (in-range)
   numeric strings must fit in this limited-size buffer, regardless of
   their actual length in the input file.

 * Refactor the PNM parsing in order to make it more capable to handle
   various kinds of input file errors.

 * Remove the volatile qualifiers from all variable declarations.
   Their original purpose was to appease old (and incorrect) warnings
   issued by ancient optimizing compilers.

 * Print a note about the program's lack of support for the PAM ("P7")
   file format when the input is in this format.

 * Add FIXME notes about the need to signal incorrect or incomplete
   input files. (For png2pnm, this is done inside libpng.)
2024-01-08 14:14:33 +02:00
Cosmin Truta
c993ae4c67 pngminus: Update CMake file; rename test scripts; add .gitignore
Raise the minimum required CMake version to 3.5.

Add the configuration option `PNGMINUS_USE_SYSTEM_PNG` for compiling
and linking with the system libpng library instead of the internal one.

Remove the old configuration option `PNGMINUS_USE_STATIC_LIBRARIES`.
When using the internal libpng (via `PNGMINUS_USE_SYSTEM_PNG=OFF`),
simply enforce static linking and produce single-file executables.

Rename the scripts "png2pnm.sh" (etc.) to "test_png2pnm.sh" (etc.),
to make it obvious that they are test drivers, not program launchers.

Add a .gitignore file for project-specific build and test artifacts.
2024-01-05 19:59:07 +02:00
Cosmin Truta
6abf8c1e91 Fix the API comment about png_data_freer
The old note about this function being unlikely to work correctly was
likely incorrect.
2024-01-03 21:13:59 +02:00
Cosmin Truta
0dfe422e9f Update the copyright year 2024-01-02 21:25:55 +02:00
John Bowler
71b9b5e16e pngfix: ensure fclose happens last on file close
This reverts the code to a variant of my old style of doing an 'fclose'
correctly and adds comments explaining why it is so difficult.  Thanks
to @ihsinme for pointing out the error on github.com

Signed-off-by: John Bowler <jbowler@acm.org>
2023-12-30 11:06:34 -08:00
Stephen Kitt
9f9f8d8e63 Fix bashisms
makepngs.sh relies on a Bash feature in one of its case statements,
";;&"; this should be made explicit in the shebang.

intgamma.sh declares a function in a manner which may fail in non-Bash
sh implementations, this patch uses the correct syntax.

Based on a patch by Roflcopter4:
https://github.com/joncampbell123/dosbox-x/pull/3850

Signed-off-by: Stephen Kitt <steve@sk2.org>
2023-12-27 12:53:48 +02:00
Cosmin Truta
437b24a958 mips: Fix the build for generic ANSI C89 compilers
The <stdint.h> header is a standard C99 header, and a MIPS-specific
header, but it is not a standard C89 header. It should not be included
until ensuring that the code being compiled is MIPS-specific.
2023-12-20 21:09:27 +02:00
Sui Jingfeng
2ed5a70bca mips: Implement the run-time MIPS MSA discovery function correctly
The old implementation of png_have_msa() caused a bus error,
if a word in /proc/cpuinfo was longer than 10 characters.

In the original implementation, `word[10]` was too short, and
`word[i++] = ch` caused a stack smash if the characters between
spaces were more than 10.

And also, fclose(f) should be called before leaving.

For example on loongson ls3a4000 cpu platform:

$ cat /proc/cpuinfo

system type             : Generic Loongson64 System
machine                 : loongson,loongson64g-4core-ls7a
processor               : 0
cpu model               : ICT Loongson-3 V0.1  FPU V0.1
BogoMIPS                : 3594.02
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 2112
extra interrupt vector  : no
hardware watchpoint     : no
isa                     : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2
ASEs implemented        : vz msa loongson-mmi loongson-cam loongson-ext loongson-ext2
shadow register sets    : 1
kscratch registers      : 6
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
processor               : 1
cpu model               : ICT Loongson-3 V0.1  FPU V0.1
BogoMIPS                : 3611.26
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 2112
extra interrupt vector  : no
hardware watchpoint     : no
isa                     : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2
ASEs implemented        : vz msa loongson-mmi loongson-cam loongson-ext loongson-ext2
shadow register sets    : 1
kscratch registers      : 6
package                 : 0
core                    : 1
VCED exceptions         : not available
VCEI exceptions         : not available

Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-20 21:09:27 +02:00
Cosmin Truta
85f866dea3 cmake: Enable policy CMP0074 for ZLIB_ROOT; deprecate PNG_BUILD_ZLIB
Although the minimum required CMake version is 3.6, this policy will
only have effect under CMake 3.12 or newer.

Reported-by: Jacob Harding <54728054+jacobharding@users.noreply.github.com>
2023-12-20 19:12:42 +02:00
Cosmin Truta
2fff013a69 cmake: Raise the minimum required version to 3.6 and use its features
Use the `CMAKE_HOST_SOLARIS` variable, introduced in CMake 3.6, and
raise `cmake_minimum_required` accordingly.
2023-12-13 20:24:33 +02:00
Cosmin Truta
acfd50ae0b cmake: Clean up functions, string operations, regular expressions, etc.
Remove the inclusion of the external module `CMakeParseArguments`.
Function argument parsing became a first-class feature in CMake 3.5.

Delete the function `find_symbol_prefix`. It is no longer used.

Use variables instead of strings in string operations where possible.
Prevent CMake from getting confused by string values that might be
accidentally identical to unrelated keywords.

Clean up spurious `.*` sequences in regex matching operations.

Rephrase a comment.
2023-12-11 20:51:06 +02:00
Cosmin Truta
8fc13a8704 cmake: Enable the libpng framework build by default on Apple systems
The PNG_FRAMEWORK option used to be off by default. It was possible to
turn it on, regardless of the underlying operating system, but doing so
outside of an Apple OS broke the libpng build.

PNG_FRAMEWORK is now on by default, conditionally defined on Apple
systems only, and it is ignored (without breaking the build) elsewhere.

Other minor changes have also been applied.
2023-12-08 23:22:39 +02:00
Timothy Lyanguzov
1460b3ce78 cmake: Use Zlib as a package
1. automatic linking of the library and add include directory
2. properly specify include directories

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-08 14:57:36 +02:00
Cosmin Truta
e1088f99d4 Redo "cmake: Fix CPU architecture regexes"
Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-07 23:17:56 +02:00
Cosmin Truta
d65b3ebf00 Revert "cmake: Fix CPU architecture regexes"
This reverts commit 9c1dc4d13dab823d6441d417546ebeee3994389b.

The new regex for Intel can match "x86_64", but it fails with "x86".
Moreover, the new regex for MIPS needs more testing on all MIPS ISAs.

Reported-by: Clinton Ingram <clinton.ingram@outlook.com>
2023-12-07 23:17:56 +02:00
Clinton Ingram
a3d1a35b98 cmake: Don't add Unix ASM file to the ARM-specific source list for MSVC
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-07 16:11:12 +02:00
Cosmin Truta
9c1dc4d13d cmake: Fix CPU architecture regexes
Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-07 16:11:12 +02:00
Cosmin Truta
e755fb79ba ci: Quick-fix ci_verify_cmake.sh
Avoid using `cmake --option=value` and `ctest --option=value`, to stay
compatible with older versions of CMake.
2023-10-19 00:26:54 +03:00
Cosmin Truta
f79c85e22d Update the configuration for Travis CI and AppVeyor CI
Update the Travis CI matrix:
 * Run ASan and UBSan unconditionally on FreeBSD and Linux, and
   not at all on Mac.
 * Remove the `CI_NO_TEST=1` runs from the environment column.

Update the AppVeyor CI matrix:
 * Replace `CI_NO_TEST=1` with `CI_CMAKE_VARS=-DPNG_TESTS=0` when
   testing Visual Studio on ARM64.

Also apply minor stylistic changes.
2023-10-18 22:31:49 +03:00
Cosmin Truta
53d2188fa5 ci: Update the support for cross-build verifications; refactor
Rename `CI_HOST_ARCH` and `CI_HOST_SYSTEM`, to `CI_BUILD_ARCH` and
`CI_BUILD_SYSTEM`, following the nomenclature used by GNU Autotools.
Unfortunately, the word "host" has confusingly opposite meanings in
CMake (and Bazel, etc.) vs. Autotools (and Meson, etc.)

Remove `CI_TARGET_TRIPLET` and `CI_TARGET_ABI` (for now).

Introduce the function `ci_expr` as a fast and easy equivalent of
`expr >/dev/null`.

Rephrase the assertions using an implementation pattern that is more
expressive, yet (arguably) just as readable. Remove `ci_assert`.

Modify the main functions to display more useful information in case
of usage error.
2023-10-18 19:36:38 +03:00
Timothy Lyanguzov
f2294569cf Use CMake 3.5 features
1. Set `cmake_minimum_required` to 3.5
   (see https://cmake.org/cmake/help/latest/release/3.27.html)
2. Specify the version of CMake project
3. Remove the redundant call to `cmake_policy`
4. Use `CMAKE_INSTALL_BINDIR` and `CMAKE_INSTALL_INCLUDEDIR`
5. Use private library linking for tools and test programs
6. Don't activate testing if it was not enabled

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-10-02 23:24:00 +03:00