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] Automatically detect newly added source files #9611

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

tkonolige
Copy link
Contributor

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

@junrushao
Copy link
Member

@tkonolige tkonolige force-pushed the cmake_configure_depends branch 2 times, most recently from 00879cb to a7b9051 Compare December 2, 2021 18:39
@areusch
Copy link
Contributor

areusch commented Dec 2, 2021

@tkonolige which platforms have you tested this on and with what versions of cmake?

@tkonolige
Copy link
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.

@tkonolige
Copy link
Contributor Author

tkonolige commented Dec 9, 2021

@areusch @junrushao1994 Could you review?

@masahi
Copy link
Member

masahi commented Dec 20, 2021

@tkonolige Please resolve the conflict.

Tristan Konolige 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.
@tkonolige tkonolige force-pushed the cmake_configure_depends branch from 3aa47e6 to 965fd2d Compare December 21, 2021 16:23
Copy link
Member

@masahi masahi left a 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

@masahi masahi merged commit d486e21 into apache:main Dec 23, 2021
@masahi
Copy link
Member

masahi commented Dec 23, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants