-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] Automatically detect newly added source files #9611
Conversation
Some relevant discussion in cmake forum: https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808 |
00879cb
to
a7b9051
Compare
@tkonolige which platforms have you tested this on and with what versions of cmake? |
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. |
@areusch @junrushao1994 Could you review? |
@tkonolige Please resolve the conflict. |
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
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 a good change, merging
thanks @tkonolige @areusch @junrushao1994 |
* [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
* [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
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