-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made some changes to the InSourceBuild CMake module in an attempt to prevent CMake-challenged individuals from trashing the source tree when performing a build.
- Loading branch information
Showing
2 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a798ba0
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.
Feedback on this change - we use the following e.g. subdirectories in source
.x86_64-libreelec-linux-gnu
not tmp, so have had to use the -DALLOW_IN_SOURCE_BUILD=ON optiona798ba0
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.
@heitbaum Your usage of ALLOW_IN_SOURCE_BUILD is fine. I don't mean to scare you with the error message that CMake prints if you attempt an in-source build. In-source builds can be quite convenient to use in some workflows. The error message about in-source builds is meant to scare people who do not really know what they are doing. The reason for making in-source builds disallowed by default is to address the growing problem that many people who do not understand CMake are doing in-source builds where the CMake binary directory is chosen to match an already existing directory in the JasPer source tree. This, results in many exotic build failures (due to trashing the JasPer source tree) that are entirely the fault of the person using CMake and not JasPer. But these users file bug reports against JasPer anyways, which is a big hassle to deal with. So, I am hoping that this policy change for in-source builds will eliminate (or at least reduce) this kind of bogus bug report. I hope that this rationale makes sense. I have no intention to completely prevent the use of in-source builds. I just want to discourage people who do not know what they are doing from using them.
a798ba0
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.
all good - fully supportive on reducing the tickets. Just thought I would share our "tmp" path logic with you too. It was a simple change for our tooling and "hopefully" we understand the ramifications :-)
a798ba0
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.
Incidentally, thank you for providing feedback on this change. It is appreciated. Just to be clear, the solution I would advocate for your case is what you are already doing, namely, using the ALLOW_IN_SOURCE_BUILD variable. I prefer not to add more regexes in the InSourceBuild CMake module for exceptions to the "no in-source build by default" policy. I simply allow "tmp*" in the top-level directory of the source tree as an exception. Adding more special cases does not scale well. Just as a point of clarification, there should not be any negative consequences to you using ALLOW_IN_SOURCE_BUILD, at least as far as JasPer is concerned and I cannot imagine that there would be any negative consequences on your side either (aside from having to add the ALLOW_IN_SOURCE_BUILD variable to your build workflow in the first place).
a798ba0
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 still would be happy if people would just search existing bugs before opening a new one :)