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

refactor: change project flag configuration behavior #1451

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Jan 27, 2023

  1. fix: projectGetCFlags

    Fixes `(Project.get-config "cflags")` so that it actually returns the
    project's C flag field. Previously it was returning the project's
    preprocessor calls.
    scolsen committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    b0c0093 View commit details
    Browse the repository at this point in the history
  2. refactor!: change project flag setting behavior

    This commit alters the project configuration compiler flag setting
    behavior to allow users to override default project flags.
    
    Flag setting commands (cflag, libflag, pkgconfigflag) now take lists of
    strings as arguments. Previously, they were append-only and accepted
    string arguments.
    
    Now, to override flags, users can call:
    
    ```
    (Project.get-config "cflag")
    => (...a bunch of default platform flags; "-wall" ...)
    (Project.config "cflag" '("-my" "-new" "-flags"))
    (Project.get-config "cflag")
    => ("-my" "-new" "-flags")
    ```
    
    In order to append flags, users now need to `cons` to a `config-get`:
    
    ```
    (Project.config "cflag" (cons "-new" (Project.get-config "cflag")))
    ```
    
    BREAKING CHANGE: Code that relies on the previous behavior will break,
    as calling these functions with non-list arguments is now an error. I
    considered a softer path whereby we'd overload the current behavior to
    avoid breaking existing users; however, the result would be confusing.
    Passing a list would result in overriding the project field while
    passing a single string would result in an append. A user might
    conceivably wonder why passing a list doesn't result in a multi-append.
    Ultimately I felt making a breaking change would be less confusing than
    this compatibility preserving behavior down the line.
    scolsen committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    74d0321 View commit details
    Browse the repository at this point in the history
  3. feat: add flag append macros

    Provides convenience macros for appending flags to project flag fields
    cflag, libflag, and pkgconfigflag.
    scolsen committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    57f1117 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2023

  1. fix: update flag-setting calls to reflect behavior changes

    Updates some project configuration calls in the Core library to follow
    the new configuration behavior (pass complete flag sets and not
    individual strings).
    scolsen committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    e5c9be7 View commit details
    Browse the repository at this point in the history
  2. fix: update add-*flag helpers

    To account for the new flag setting configuration behavior.
    scolsen committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    09565f0 View commit details
    Browse the repository at this point in the history
  3. fix: temporary kludge for clang

    Adds a preload eval to set the -Wnounknown-warning-option flag in clang
    -- this way, when different versions don't support our default flag set,
    they can still run tests. Otherwise passing an unknown flag to clang
    results in a compilation error.
    scolsen committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    a28385a View commit details
    Browse the repository at this point in the history