Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake-remake #1027

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
31e17ef
added options for shared and static build
Nov 30, 2024
94f1374
switch to use GNUInstallDirs
Nov 30, 2024
66e6844
install libs with static and debug suffix
Nov 30, 2024
116ad2d
add pdb install, fully superseeds #976
Nov 30, 2024
2cfba4d
bump min version again as cmake complains if it's < 3.5
Dec 1, 2024
25e7113
move versionscript block to zlib definition
Dec 1, 2024
cbd0257
set version in project call and use the vars set by it
Dec 1, 2024
37f5f16
renamed examples and tests for not be confused when chainbuilding
Dec 1, 2024
5b1dbeb
remove unneeded renaming for intree builds and the option for it
Dec 1, 2024
c6b9b63
remove checks for sys/types.h, stdint.h and stddef.h as this is done …
Dec 1, 2024
7e7ff50
remove doubled include directories
Dec 1, 2024
4b6b1c1
move compile_definitions to the targets
Dec 1, 2024
aad839e
use the same definition we checked with for off64_t and move to targe…
Dec 1, 2024
4900299
let cmake handle zlib1.rc
Dec 1, 2024
b8eacab
there are no loose loops
Dec 1, 2024
f2a416e
consistent formatting fix
Dec 1, 2024
5a22833
one install option is enough, everything else can be choosen with com…
Dec 1, 2024
d19fc12
the examples are only build to run the tests, so the option should re…
Dec 1, 2024
537ff61
moved versionsetting for cygwin into set_target_properties to not sca…
Dec 1, 2024
969ccfa
use CMAKE_DEBUG_SUFFIX to reduce lines
Dec 2, 2024
cb18a86
add zlib1.rc to cygwin build
Dec 2, 2024
4a7de67
add INSTALL_INTERFACE for proper export
Dec 2, 2024
946f565
add aliases to match the exportnames and use them
Dec 2, 2024
115f2b7
warn if no build-type is selected
Dec 3, 2024
cd0d8b4
proper export
Dec 3, 2024
dd60bc5
install can put different files into different locations
Dec 3, 2024
b6b3494
add test for usage with find_package
Dec 3, 2024
8bb8b91
added more tests
Dec 4, 2024
3a38a9e
set platform and config right for the tests
Dec 5, 2024
1167e50
added version to the expoted config
Dec 5, 2024
73fb8cc
pass also CC and CFLAGS to the tests
Dec 5, 2024
d2af544
ZLIB_BUILD_EXMAPLES is no valid option anymore
Dec 5, 2024
ed0c94e
cygwin renames the shared to cygz.dll
Dec 5, 2024
f842b90
compat copy for mingw
Dec 5, 2024
bf99e64
test mingw and cygwin disabled
Dec 5, 2024
329ce32
also test static
Dec 5, 2024
d77537c
adapt pkgconfig-file to GnuInstallDirs layout
Dec 5, 2024
80cab8c
silence deprecation warning on the action runners
Dec 5, 2024
ee3db17
add option for z-prefix
Dec 7, 2024
48e4563
create zconf.h from zconf.h.in
Dec 7, 2024
55c5924
zconf.h is always created by cmake and configure
Dec 7, 2024
16c8eb7
use unset for clearing a var
Dec 11, 2024
5276397
detect visibility in MSVC better
Dec 11, 2024
763a995
type in define
Dec 11, 2024
149c46d
use the right version
Dec 11, 2024
60edba8
switch to clearer signature of add_test
Dec 11, 2024
341239a
testname shortening
Dec 11, 2024
2009fc5
fix parrallel testing
Dec 11, 2024
cb47dd8
add minizip
Dec 11, 2024
c0a97e2
rename exports of minizip as minizip-ng has prior art
Dec 12, 2024
0802457
rename exports of minizip as minizip-ng has prior art
Vollstrecker Dec 15, 2024
172983e
ints.h is also needed to be installed
Dec 15, 2024
5a60987
FindZLIB so also ZLIB.cmake
Dec 15, 2024
a885f01
nail minizip to search for config as the module doesn't work
Dec 15, 2024
5d30359
move test into test-dir and set the right env to find the libs
Dec 22, 2024
8160aeb
also test with minizip
Dec 24, 2024
422ec5f
corrected target
Dec 24, 2024
c663df1
add coverage test
Dec 24, 2024
82d59a4
fix cover in Makefile.in
Dec 24, 2024
a26655e
typo in define
Dec 24, 2024
cded01f
forgot coverage test prefix
Dec 25, 2024
110b0f1
split build of infcover and minizip as they have known warnings
Dec 25, 2024
e25499f
one build with Werror should be enough
Dec 25, 2024
a7323ed
qemu is qemu-system in ubuntu 24.04
Dec 25, 2024
063dc8f
adjust to tests to 3.10 and ZLIB also
Dec 25, 2024
88954ef
wrong build-dir in second run
Dec 25, 2024
b9842cd
adjust for llvm gcov calling convention
Dec 25, 2024
5b4aa67
Adjust minizip tests
Dec 25, 2024
05ca1d4
handle clang without version suffix
Dec 25, 2024
967358e
one missing -Werror
Dec 25, 2024
dc34211
disable make cover as no gcov was found
Dec 25, 2024
79a2866
correct comments to satisfy standard
Dec 26, 2024
1c3d794
stop if miizip is compiled on 32 bit
Dec 26, 2024
7ffd784
one more comment on win
Dec 26, 2024
1793dd0
added CPack
Dec 26, 2024
e3fb085
added packaging to tests
Dec 26, 2024
c4850b8
depend on bzip2 only if it's found
Dec 27, 2024
6b0224a
uncomment stop-sign
Dec 27, 2024
4d59e1a
cmake is designed for out-of-tree builds
Dec 27, 2024
4415c9d
make bzip2 really optional
Dec 27, 2024
f356ba2
sort includes
Dec 30, 2024
cc6fa69
prevent double inclusion of CPack warning
Dec 30, 2024
4a81a7d
if bzip2 is requested, it's required
Dec 30, 2024
d132825
search for zlib by config to get all needed targets
Dec 30, 2024
05e10b5
format fix
Dec 30, 2024
c1d362c
linking to bzip2 is not needed
Dec 30, 2024
ceac2b1
refine all tests
Dec 30, 2024
734555a
added components selection
Dec 31, 2024
1fd4e1d
fix wording in minizip options
Dec 31, 2024
15c32d3
rename option to ZLIB_INSTALL as not only libs are installed
Dec 31, 2024
22d4983
re-add lost var
Dec 31, 2024
24bfa06
added README.cmake
Dec 31, 2024
be37b17
one more alias for llvm-cov
Dec 31, 2024
450fcfd
reenabled cygwin and msys tests
Dec 31, 2024
982f03e
disable bzip2 for tests as it's not everywhere installed
Dec 31, 2024
3824b73
HOMPAGE_URL was introduced in 3.12 - missed that one
Dec 31, 2024
d2ce756
Disable testing on cygwin
Dec 31, 2024
6e23477
removed unused var
Jan 3, 2025
c2b5faf
add cmake-format.yaml and reformat all files
Jan 3, 2025
c11199b
fixed typo
Jan 3, 2025
dfe37b1
Reenabled cygwin tests without ninja
Jan 22, 2025
f742eb3
make bzip2 part of interface
Jan 22, 2025
63dc643
moved to README-cmake.md as @ClausKlein suggested
Jan 22, 2025
e9128dc
reenabled testing with bzip2
Jan 22, 2025
0c19f5b
add make to cygwin
Jan 22, 2025
04cb319
install missing bzip2
Jan 22, 2025
95a1ae5
switch back to ninja and limit to 1 job
Jan 22, 2025
392361b
runner.os is not Ubuntu
Jan 22, 2025
f8eefc6
install bzip2 on cygwin
Jan 22, 2025
80b15b2
no test for bzip2 on win and cygwin
Jan 22, 2025
b1f908d
set tested version as @ClausKlein suggested
Jan 22, 2025
9afa2a6
I hate yaml
Jan 22, 2025
33c9acf
too much spaces
Jan 22, 2025
3189b02
one missing \
Jan 22, 2025
d06be48
disable minizip on cygwin
Jan 22, 2025
d0fca64
also give minizip a suffix on cygwin
Jan 24, 2025
26d0688
make USE_FILE32API part of the interface
Jan 24, 2025
510a89a
Merge pull request #4 from cmake-remake/new-cyg
Vollstrecker Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 245 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
_help_parse: Options affecting listfile parsing
parse:
_help_additional_commands:
- Specify structure for custom cmake functions
additional_commands:
foo:
flags:
- BAR
- BAZ
kwargs:
HEADERS: '*'
SOURCES: '*'
DEPENDS: '*'
_help_override_spec:
- Override configurations per-command where available
override_spec: {}
_help_vartags:
- Specify variable tags.
vartags: []
_help_proptags:
- Specify property tags.
proptags: []
_help_format: Options affecting formatting.
format:
_help_disable:
- Disable formatting entirely, making cmake-format a no-op
disable: false
_help_line_width:
- How wide to allow formatted cmake files
line_width: 80
_help_tab_size:
- How many spaces to tab for indent
tab_size: 4
_help_use_tabchars:
- If true, lines are indented using tab characters (utf-8
- 0x09) instead of <tab_size> space characters (utf-8 0x20).
- In cases where the layout would require a fractional tab
- character, the behavior of the fractional indentation is
- governed by <fractional_tab_policy>
use_tabchars: false
_help_fractional_tab_policy:
- If <use_tabchars> is True, then the value of this variable
- indicates how fractional indentions are handled during
- whitespace replacement. If set to 'use-space', fractional
- indentation is left as spaces (utf-8 0x20). If set to
- '`round-up` fractional indentation is replaced with a single'
- tab character (utf-8 0x09) effectively shifting the column
- to the next tabstop
fractional_tab_policy: use-space
_help_max_subgroups_hwrap:
- If an argument group contains more than this many sub-groups
- (parg or kwarg groups) then force it to a vertical layout.
max_subgroups_hwrap: 2
_help_max_pargs_hwrap:
- If a positional argument group contains more than this many
- arguments, then force it to a vertical layout.
max_pargs_hwrap: 6
_help_max_rows_cmdline:
- If a cmdline positional group consumes more than this many
- lines without nesting, then invalidate the layout (and nest)
max_rows_cmdline: 2
_help_separate_ctrl_name_with_space:
- If true, separate flow control names from their parentheses
- with a space
separate_ctrl_name_with_space: false
_help_separate_fn_name_with_space:
- If true, separate function names from parentheses with a
- space
separate_fn_name_with_space: false
_help_dangle_parens:
- If a statement is wrapped to more than one line, than dangle
- the closing parenthesis on its own line.
dangle_parens: false
_help_dangle_align:
- If the trailing parenthesis must be 'dangled' on its on
- 'line, then align it to this reference: `prefix`: the start'
- 'of the statement, `prefix-indent`: the start of the'
- 'statement, plus one indentation level, `child`: align to'
- the column of the arguments
dangle_align: prefix
_help_min_prefix_chars:
- If the statement spelling length (including space and
- parenthesis) is smaller than this amount, then force reject
- nested layouts.
min_prefix_chars: 4
_help_max_prefix_chars:
- If the statement spelling length (including space and
- parenthesis) is larger than the tab width by more than this
- amount, then force reject un-nested layouts.
max_prefix_chars: 10
_help_max_lines_hwrap:
- If a candidate layout is wrapped horizontally but it exceeds
- this many lines, then reject the layout.
max_lines_hwrap: 2
_help_line_ending:
- What style line endings to use in the output.
line_ending: unix
_help_command_case:
- Format command names consistently as 'lower' or 'upper' case
command_case: canonical
_help_keyword_case:
- Format keywords consistently as 'lower' or 'upper' case
keyword_case: unchanged
_help_always_wrap:
- A list of command names which should always be wrapped
always_wrap: []
_help_enable_sort:
- If true, the argument lists which are known to be sortable
- will be sorted lexicographicall
enable_sort: true
_help_autosort:
- If true, the parsers may infer whether or not an argument
- list is sortable (without annotation).
autosort: false
_help_require_valid_layout:
- By default, if cmake-format cannot successfully fit
- everything into the desired linewidth it will apply the
- last, most aggressive attempt that it made. If this flag is
- True, however, cmake-format will print error, exit with non-
- zero status code, and write-out nothing
require_valid_layout: false
_help_layout_passes:
- A dictionary mapping layout nodes to a list of wrap
- decisions. See the documentation for more information.
layout_passes: {}
_help_markup: Options affecting comment reflow and formatting.
markup:
_help_bullet_char:
- What character to use for bulleted lists
bullet_char: '*'
_help_enum_char:
- What character to use as punctuation after numerals in an
- enumerated list
enum_char: .
_help_first_comment_is_literal:
- If comment markup is enabled, don't reflow the first comment
- block in each listfile. Use this to preserve formatting of
- your copyright/license statements.
first_comment_is_literal: false
_help_literal_comment_pattern:
- If comment markup is enabled, don't reflow any comment block
- which matches this (regex) pattern. Default is `None`
- (disabled).
literal_comment_pattern: null
_help_fence_pattern:
- Regular expression to match preformat fences in comments
- default= ``r'^\s*([`~]{3}[`~]*)(.*)$'``
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$
_help_ruler_pattern:
- Regular expression to match rulers in comments default=
- '``r''^\s*[^\w\s]{3}.*[^\w\s]{3}$''``'
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$
_help_explicit_trailing_pattern:
- If a comment line matches starts with this pattern then it
- is explicitly a trailing comment for the preceding argument.
- Default is '#<'
explicit_trailing_pattern: '#<'
_help_hashruler_min_length:
- If a comment line starts with at least this many consecutive
- hash characters, then don't lstrip() them off. This allows
- for lazy hash rulers where the first hash char is not
- separated by space
hashruler_min_length: 10
_help_canonicalize_hashrulers:
- If true, then insert a space between the first hash char and
- remaining hash chars in a hash ruler, and normalize its
- length to fill the column
canonicalize_hashrulers: true
_help_enable_markup:
- enable comment markup parsing and reflow
enable_markup: true
_help_lint: Options affecting the linter
lint:
_help_disabled_codes:
- a list of lint codes to disable
disabled_codes: []
_help_function_pattern:
- regular expression pattern describing valid function names
function_pattern: '[0-9a-z_]+'
_help_macro_pattern:
- regular expression pattern describing valid macro names
macro_pattern: '[0-9A-Z_]+'
_help_global_var_pattern:
- regular expression pattern describing valid names for
- variables with global (cache) scope
global_var_pattern: '[A-Z][0-9A-Z_]+'
_help_internal_var_pattern:
- regular expression pattern describing valid names for
- variables with global scope (but internal semantic)
internal_var_pattern: _[A-Z][0-9A-Z_]+
_help_local_var_pattern:
- regular expression pattern describing valid names for
- variables with local scope
local_var_pattern: '[a-z][a-z0-9_]+'
_help_private_var_pattern:
- regular expression pattern describing valid names for
- privatedirectory variables
private_var_pattern: _[0-9a-z_]+
_help_public_var_pattern:
- regular expression pattern describing valid names for public
- directory variables
public_var_pattern: '[A-Z][0-9A-Z_]+'
_help_argument_var_pattern:
- regular expression pattern describing valid names for
- function/macro arguments and loop variables.
argument_var_pattern: '[a-z][a-z0-9_]+'
_help_keyword_pattern:
- regular expression pattern describing valid names for
- keywords used in functions or macros
keyword_pattern: '[A-Z][0-9A-Z_]+'
_help_max_conditionals_custom_parser:
- In the heuristic for C0201, how many conditionals to match
- within a loop in before considering the loop a parser.
max_conditionals_custom_parser: 2
_help_min_statement_spacing:
- Require at least this many newlines between statements
min_statement_spacing: 1
_help_max_statement_spacing:
- Require no more than this many newlines between statements
max_statement_spacing: 2
max_returns: 6
max_branches: 12
max_arguments: 5
max_localvars: 15
max_statements: 50
_help_encode: Options affecting file encoding
encode:
_help_emit_byteorder_mark:
- If true, emit the unicode byte-order mark (BOM) at the start
- of the file
emit_byteorder_mark: false
_help_input_encoding:
- Specify the encoding of the input file. Defaults to utf-8
input_encoding: utf-8
_help_output_encoding:
- Specify the encoding of the output file. Defaults to utf-8.
- Note that cmake only claims to support utf-8 so be careful
- when using anything else
output_encoding: utf-8
_help_misc: Miscellaneous configurations options.
misc:
_help_per_command:
- A dictionary containing any per-command configuration
- overrides. Currently only `command_case` is supported.
per_command: {}
34 changes: 28 additions & 6 deletions .github/workflows/c-std.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,30 @@ jobs:
- name: Generate project files (cmake)
if: matrix.builder == 'cmake'
run: |
cmake -S . -B . -D CMAKE_BUILD_TYPE=Release -D ZLIB_BUILD_EXAMPLES=OFF ${{ matrix.os.cmake-opt }}
cmake -S . -B ./build1 -D CMAKE_BUILD_TYPE=Release ${{ matrix.os.cmake-opt }} -DZLIB_BUILD_TESTING=OFF
env:
CC: ${{ matrix.compiler }}
CFLAGS: -std=${{ matrix.std.value }} ${{ matrix.arch.compiler-opt }} -Werror -Wall -Wextra

- name: Generate project files with tests (cmake)
if: matrix.builder == 'cmake'
run: |
cmake -S . -B ./build2 -D CMAKE_BUILD_TYPE=Release ${{ matrix.os.cmake-opt }} -DZLIB_BUILD_MINIZIP=ON -DMINIZIP_ENABLE_BZIP2=OFF
env:
CC: ${{ matrix.compiler }}
CFLAGS: -std=${{ matrix.std.value }} ${{ matrix.arch.compiler-opt }} -Wall -Wextra

- name: Compile source code (cmake)
if: matrix.builder == 'cmake'
run: cmake --build . --config Release
run: cmake --build ./build1 --config Release

- name: Compile source code with tests (cmake)
if: matrix.builder == 'cmake'
run: cmake --build ./build2 --config Release

- name: Run test cases (cmake)
if: matrix.builder == 'cmake'
run: ctest -C Release --output-on-failure --max-width 120
run: ctest ./build2 -C Release --output-on-failure --max-width 120


msvc:
Expand Down Expand Up @@ -196,13 +208,23 @@ jobs:

- name: Generate project files (cmake)
run: |
cmake -S . -B . ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release
cmake -S . -B ./build1 ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release -DZLIB_BUILD_TESTING=OFF
env:
CC: ${{ matrix.compiler }}
CFLAGS: /WX ${{ matrix.std.value }}

- name: Generate project files with tests (cmake)
run: |
cmake -S . -B ./build2 ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release -DZLIB_BUILD_MINIZIP=ON -DMINIZIP_ENABLE_BZIP2=OFF
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.std.value }}

- name: Compile source code (cmake)
run: cmake --build . --config Release -v
run: cmake --build ./build1 --config Release -v

- name: Compile source code with tests(cmake)
run: cmake --build ./build2 --config Release -v

- name: Run test cases (cmake)
run: ctest -C Release --output-on-failure --max-width 120
run: ctest ./build2 -C Release --output-on-failure --max-width 120
Loading
Loading