Skip to content

Commit

Permalink
[DDA Port] Various improvements to CMake builds (#3208)
Browse files Browse the repository at this point in the history
* Change glob pattern to include alphabetic versions (0.A, ...)

Cherry-picked from commit 35e3ee7

* Fix cmake not generating game version correctly

Cherry-picked from commit de1a6ccc325e0682983f3f19446822e4c8e5a514

* CMake linting

* format cmake files to adhere to linting rules

* cmake linting workflow/action

Cherry-picked from a149ceb00807a323cd7eba5fa7a3a7c8b3b0b1b2

* Apply cmake-format

* Autofix CMake formatting

* Apply cmake-format x2

* Remove dupe conditions from else and endif

* Split up long message lines

* Remove mentions of INSTALL file.

* Improve CMake build script for macOS

Cherry-picked from commit 84165ee535561773058130402510657b3621edf1

* cmake: install help directory

Cherry-picked from commit 7e588b20ec89abf6de6f674975f814803d9c5e7e

* cmake: don't use PREFIX

`PREFIX` is a reserved word in CMake and breaks compiler and library detection
when set.  Using `CMAKE_INSTALL_PREFIX` instead resolves this.

Cherry-picked from commit: 7cbcecb18f3c9f91160a0ec45a04d61221096670

* cmake: set RELEASE variable to generate install target

Cherry-picked from commit: db8f0d3de2f69c4b355afc9a6153da8abeb63f54

* Set directories on macOS in CMake build script

Cherry-picked from commit: 45f6a3b77fd07563a4625b1f313d2c4cb797db0d

* cmake: simplify random seed generation for tests

Cherry-picked from commit ff4db050877c4cdcb9ae2e5b247eb4f70c1d3eb4

* Fix style

* Allow build and run in repo folder in CMake

Cherry-picked from commit: 256ef3388407e66b9edaac91ef5993a89511fad7

* Avoid ambiguity in CMake if commands

Cherry-picked from commit: f9008b743357fd0eeed206437d284864783015a1

* Fix compilation on MSYS curses emulation environment

Cherry-picked from commit: 69a29a0c8ca772ba4ac7b27fefbc7fc48895258e

* Install cmake-format for autofix

* Bump cmake_minimum_required for chkjson

* Fix error in lang install dir

---------

Co-authored-by: Kasper Rasmussen <[email protected]>
Co-authored-by: Jianxiang Wang (王健翔) <[email protected]>
Co-authored-by: lopho <[email protected]>
Co-authored-by: Binrui Dong <[email protected]>
Co-authored-by: J.W. Jagersma <[email protected]>
Co-authored-by: John Bytheway <[email protected]>
  • Loading branch information
7 people authored Sep 23, 2023
1 parent f1d5319 commit c8deaa7
Show file tree
Hide file tree
Showing 15 changed files with 661 additions and 653 deletions.
43 changes: 43 additions & 0 deletions .cmake-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# options affecting formatting
format:
# how wide to allow formatted cmake files
line_width: 100
# how many spaces to tab for indent
tab_size: 4
# if true, separate flow control names from their parentheses
separate_ctrl_name_with_space: true # currently ignored by cmake-lint
# if true, separate function names from parentheses with a
separate_fn_name_with_space: false # currently ignored by cmake-lint
# if a statement is wrapped to more than one line, than dangle
# the closing parenthesis on its own line.
dangle_parens: false # currently ignored by cmake-lint
# Format command names consistently as 'lower' or 'upper' case
# 'canonical': like in official documentation
command_case: 'canonical' # currently ignored by cmake-lint
# Format keywords consistently as 'lower' or 'upper' case
keyword_case: 'upper' # currently ignored by cmake-lint
# options affecting comment reflow and formatting
markup:
# enable comment markup parsing and reflow
enable_markup: false
# options affecting linter
lint:
# list of lint codes to disable
# C0113: Missing COMMENT in statement which allows it
disabled_codes: ['C0113']
# regular expression pattern describing valid function names
function_pattern: '[a-z_]+'
# regular expression pattern describing valid names for private variables
# WEIRD: strangely named "directory variable name" in lint output
private_var_pattern: '_[0-9A-Z_]+'
# regular expression pattern describing valid names for public variables (strangely named "directories"?)
# WEIRD: strangely named "directory variable name" in lint output
public_var_pattern: '[0-9A-Z]+'
# regular expression pattern describing valid macro names
macro_pattern: '[a-z_]+'
# regular expression pattern describing valid names for function/macro
# arguments and loop variables
argument_var_pattern: '[A-Z][A-Z0-9_]+'
# require no more than this many newlines between statements
max_statement_spacing: 2

5 changes: 5 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:

- run: sudo apt-get install astyle

- run: sudo pip install cmakelang

- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
Expand All @@ -28,6 +30,9 @@ jobs:
- name: format markdown files
run: deno fmt

- name: format CMake files
run: make cmake-format

- name: json formatting
run: make style-all-json-parallel RELEASE=1

Expand Down
Loading

0 comments on commit c8deaa7

Please sign in to comment.