[CMAKE] Automatically detect newly added source files#9611
Merged
Conversation
Member
|
Some relevant discussion in cmake forum: https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808 |
00879cb to
a7b9051
Compare
Contributor
|
@tkonolige which platforms have you tested this on and with what versions of cmake? |
Contributor
Author
|
Tested on linux with cmake 3.18 and 3.10 (support for configure_depends was added in 3.12). Are there any more platforms you would like tested? CI should get windows and macOS, but I'm not sure what version there are using. |
Contributor
Author
|
@areusch @junrushao1994 Could you review? |
Member
|
@tkonolige Please resolve the conflict. |
added 2 commits
December 21, 2021 08:23
Before this commit, newly added or removed source files were not detected by cmake. This manifested either as file not found errors from the compiler (when files were deleted) or packedfuncs not being found (when files were added). This commit uses the CONFIGURE_DEPENDS option of cmake's `file(GLOB)` function to ask the build system to check for new files on every rebuild. Checking for new files adds a slight but negligible overhead to each build, but is better than unexpected errors.
3aa47e6 to
965fd2d
Compare
masahi
approved these changes
Dec 23, 2021
masahi
left a comment
Member
There was a problem hiding this comment.
I think this is a good change, merging
Member
|
thanks @tkonolige @areusch @junrushao1994 |
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
* [CMAKE] Automatically detect newly added source files Before this commit, newly added or removed source files were not detected by cmake. This manifested either as file not found errors from the compiler (when files were deleted) or packedfuncs not being found (when files were added). This commit uses the CONFIGURE_DEPENDS option of cmake's `file(GLOB)` function to ask the build system to check for new files on every rebuild. Checking for new files adds a slight but negligible overhead to each build, but is better than unexpected errors. * remove unnessesary configure_depends
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
* [CMAKE] Automatically detect newly added source files Before this commit, newly added or removed source files were not detected by cmake. This manifested either as file not found errors from the compiler (when files were deleted) or packedfuncs not being found (when files were added). This commit uses the CONFIGURE_DEPENDS option of cmake's `file(GLOB)` function to ask the build system to check for new files on every rebuild. Checking for new files adds a slight but negligible overhead to each build, but is better than unexpected errors. * remove unnessesary configure_depends
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this commit, newly added or removed source files were not detected by cmake. This manifested either as file not found errors from the compiler (when files were deleted) or packedfuncs not being found (when files were added). This commit uses the CONFIGURE_DEPENDS option of cmake's
file(GLOB)function to ask the build system to check for new files on every rebuild. Checking for new files adds a slight but negligible overhead to each build, but is better than unexpected errors.Note that the cmake documentation recommends avoiding CONFIGURE_DEPENDS in favor of manually listing all files. This approach has been proposed in the past, but the community did not want to do it.
@electriclilies @junrushao1994 @areusch @jroesch @tqchen @leandron