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

Generate project in separate directory, keep submodule dirs clean #77

Closed
wants to merge 1 commit into from

Conversation

halcyonx
Copy link

@halcyonx halcyonx commented Jul 8, 2019

Changed the output directory for premake generated projects and obj files.
I think it is better to keep generated solution and intermediate binaries in the separated directory than in many other places in the repo.

The result is following directory tree:
─project
├───build
│ ├───bin
│ │ └───Debug-windows-x86_64
│ │ ├───Glad
│ │ ├───GLFW
│ │ ├───Hazel
│ │ ├───ImGui
│ │ └───Sandbox
│ └───bin-int
│ └───Debug-windows-x86_64
│ ├───Glad
│ ├───GLFW
│ ├───Hazel
│ ├───ImGui
│ └───Sandbox
├───Hazel
└───Sandbox

There are also requests for glfw and imgui submodules:
TheCherno/imgui#6
TheCherno/glfw#7

@DaveAxiom
Copy link
Contributor

All intermediate build files are stored in "bin-int/". This is explicit to keep all output directories "bin" and "bin-int" in alphabetical order to make it easy to delete.

@halcyonx
Copy link
Author

I think there is no any reason to keep 'bin', 'bin-int' or any other generated files in submodules or in other subdirectories of repository.
now git shows us:
modified: Hazel/vendor/GLFW (untracked content) modified: Hazel/vendor/imgui (untracked content) + a generated files like *.vcxproj, *.filters and Hazel.sln that located in different directories.
I think keeping all this stuff together in separate dir(build or project) is more consistent way.
git status is clean and rm -rf project is easier for cleaning all stuff.

@LovelySanta
Copy link
Collaborator

LovelySanta commented Jul 10, 2019

now git shows us:
modified: Hazel/vendor/GLFW (untracked content) modified: Hazel/vendor/imgui (untracked content) + a generated files like *.vcxproj, *.filters and Hazel.sln that located in different directories.
I think keeping all this stuff together in separate dir(build or project) is more consistent way.
git status is clean and rm -rf project is easier for cleaning all stuff.

The argument of moving the bin and bin-int out of the submodules to keep git status clean is invalid as the visual studio files (*.vcxproj, *.vcxproj.filters) files will always be in that directory anyway.

A beter solution for this is to add the bin; bin-int and vs-files to the .gitignore of the submodules. This way it should ignore those and won't show up as untracked content.

We did add bin and bin-int to the .gitignore while working on the linux support. Once we merge that all in, we could revisit this to add the VS files to it as well?

@DaveAxiom
Copy link
Contributor

The compiled objects in the submodules aren't relevant because they honestly don't need to be rebuilt. The hacking is done on Hazel itself. I'll give it that the file management is a little problematic since the Hazel repository puts premake files into the submodule directories!

@halcyonx
Copy link
Author

halcyonx commented Jul 10, 2019

The argument of moving the bin and bin-int out of the submodules to keep git status clean is invalid as the visual studio files (*.vcxproj, *.vcxproj.filters) files will always be in that directory anyway.
I don't think they should be tracked by git because it should be generated by premake. I thought it is not a bad idea to keep all generated and compiled stuff in some build dir, like in cmake:
mkdir build && cd build && cmake ..
UPD:
Just to clarify, workspace has location "project", Hazel and Sandbox have location "project/%{prj.name}", vs-generated files will be placed into "project" folder

@Gaztin Gaztin added the Impact:Suggestion Suggestions label Aug 2, 2019
@CleverSource
Copy link
Contributor

CleverSource commented Aug 25, 2019

Should this have the label of "Awaiting Cherno's Approval"? Reason being is because I feel like removal of files or changing the directory requires an "executive" decision from him.

Generally I think Cherno should give input on if he would want this or not, and if he wouldn't it could be closed.

@LovelySanta
Copy link
Collaborator

This requires the submodules to be merged first anyway... and only cherno can merge in submodules anyway...

@LovelySanta
Copy link
Collaborator

With #228 merged, the git status command no longer tells us that ImGui is modified. It was only spitting it out because the VS files were not ignored. As mentioned in #215, we can still think about generating all project files (maybe all except the solution file) in a separate build directory, which could also include the bin and bin-int directories. Make a separate PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants