Recursively create target folder before attempting to compile there #327
+28
−0
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.
Minor Issue: Compiling will fail with an unintuitive error (linker error) if the destination folder does not exist. This is more common an issue when using a Project and Build All Targets rather than Create Executable and manually browsing to a destination.
Proposed Solution: Right before compiling, automatically create the destination folder, including its parent folders, recursively if necessary. I think this is a reasonable expected behavior.
More Context: When working on a large cross-platform project, you might organize your build targets into nested subfolders, for example
<project>/build/demo/windows/x86/MyApp.exe
or<project>/build/full/linux/x64/MyApp
. Build All will fail if these subfolders don't exist. Manually preparing the output folder structures on several systems can be annoying... Before you ask "Why can't you just copy the folder structure around?" If you're working with Git, Git does not preserve folders which contain no files or nested files! So any time yougit clone
orgit pull
or evengit archive --format zip
, it does not carry along empty folder structures. (Also, it's common to.gitignore
yourbuild
output folder anyway.)Thanks for considering.