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: Warn Unknown Build Type #563

Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jul 14, 2021

Warn if a build type passed by a user is not known in project build.

CMake Warning at cmake/HiPACEFunctions.cmake:76 (message):
  CMAKE_BUILD_TYPE 'adsads' is not one of
  Release;Debug;MinSizeRel;RelWithDebInfo.  Is this a typo?
Call Stack (most recent call first):
  CMakeLists.txt:94 (set_default_build_type)

Summary:

  Build type: adsads (unknown type, check warning)

This helps if one accidentially writes debug instead of Debug, for instance. The result of a custom type that is undefined are no compiler (optimization/debug) flags at all...

Same as ECP-WarpX/WarpX#2088

  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@ax3l ax3l added the build CMake, compilation, etc. label Jul 14, 2021
@ax3l ax3l changed the title Warn if a build type passed by a user is not known in project build. CMake: Warn Unknown Build Type Jul 14, 2021
Warn if a build type passed by a user is not known in project build.

```
CMake Warning at cmake/HiPACEFunctions.cmake:76 (message):
  CMAKE_BUILD_TYPE 'adsads' is not one of
  Release;Debug;MinSizeRel;RelWithDebInfo.  Is this a typo?
Call Stack (most recent call first):
  CMakeLists.txt:94 (set_default_build_type)
```

Summary:
```
  Build type: adsads (unknown type, check warning)
```

This helps if one accidentially writes `debug` instead of `Debug`,
for instance. The result of a custom type that is undefined are no
compiler (optimization/debug) flags at all...
@ax3l ax3l force-pushed the topic-cmakeWarnUnknownBuildType branch from c2c5399 to ea8f2ab Compare July 14, 2021 20:31
Copy link
Member

@SeverinDiederichs SeverinDiederichs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this useful safety check!

@SeverinDiederichs SeverinDiederichs merged commit 21304bb into Hi-PACE:development Jul 15, 2021
@ax3l ax3l deleted the topic-cmakeWarnUnknownBuildType branch July 15, 2021 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CMake, compilation, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants