-
Notifications
You must be signed in to change notification settings - Fork 406
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
In source build failure warning #3082
In source build failure warning #3082
Conversation
Can one of the admins verify this patch? |
Codecov Report
@@ Coverage Diff @@
## develop #3082 +/- ##
=========================================
- Coverage 85.6% 85.6% -0.1%
=========================================
Files 122 122
Lines 10391 10391
=========================================
- Hits 8905 8904 -1
- Misses 1486 1487 +1
Continue to review full report at Codecov.
|
OK to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it redundant to say "FATAL
CMakeLists.txt
Outdated
@@ -1,4 +1,10 @@ | |||
|
|||
# Disable in-source builds to prevent source tree corruption. | |||
if( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" ) | |||
message( FATAL_ERROR "FATAL: In-source builds are not allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do this as a single-line string and let CMake do the wrapping. This prints weirdly on my terminal.
Maybe redundant to say "FATAL"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my terminal, FATAL appears only once. Thus in my case, i don't see any redundancy:
CMake Error at CMakeLists.txt:4 (message):
FATAL: In-source builds are not allowed. You should create a separate
directory for build files.
-- Configuring incomplete, errors occurred!
if( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" ) | ||
message( FATAL_ERROR "FATAL: In-source builds are not allowed. | ||
You should create a separate directory for build files." ) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't care about case anymore, but in the past we had wanted to follow Trilinos use of upper case. @dalg24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find any reference to Trilinos cmake coding style. Could you explain a little further?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. Trilinos generally makes all function calls to cmake all upper case. But I don't really care either. Actually I think that it would be nicer to have all function calls lower case. Makes it easier to see most of our variables since they are mostly upper case.
This PR is an answer to #3081
It just adds a FATAL_ERROR in message with explanation in case of in-source build.