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

Attempt at simplifying the file structure and CMake build #961

Merged
merged 53 commits into from
Sep 29, 2024

Conversation

starseeker
Copy link
Contributor

Collapses the various features into libmanifold, with configure options to enable/disable them.

Groups public headers in include/manifold.

Adjustments to the exported targets to try and avoid invoking the download steps in users of an installed Manifold library.

@starseeker
Copy link
Contributor Author

Follow-on from #945 and #953

@starseeker
Copy link
Contributor Author

@elalish I'll pick back up with the EXPORT config logic on Monday... getting closer at least.

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.76%. Comparing base (d437097) to head (79bfc42).
Report is 109 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #961      +/-   ##
==========================================
- Coverage   91.84%   86.76%   -5.08%     
==========================================
  Files          37       61      +24     
  Lines        4976     8492    +3516     
  Branches        0     1044    +1044     
==========================================
+ Hits         4570     7368    +2798     
- Misses        406     1124     +718     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this all together - and great to see it passing our CI. @kintel @fire @wtholliday please put your two cents in here too - would be nice to not have to redo this again, and I don't have a strong opinion on structure besides making it easy to consume downstream.

include/manifold/tri_dist.h Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
include/manifold/CMakeLists.txt Outdated Show resolved Hide resolved
include/manifold/conv.h Outdated Show resolved Hide resolved
@wtholliday
Copy link
Contributor

please put your two cents in here too

I'm not qualified to evaluate the cmake stuff, but the directory structure makes me happy :)

Copy link
Collaborator

@pca006132 pca006132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw maybe we should take the chance to change MANIFOLD_PAR to ON/OFF as well, we no longer have multiple backends anyway

sh/format.sh Outdated Show resolved Hide resolved
manifoldConfig.cmake.in Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@starseeker
Copy link
Contributor Author

btw maybe we should take the chance to change MANIFOLD_PAR to ON/OFF as well, we no longer have multiple backends anyway

Do you want to make it binary just in CMake, or also in the C++ source code? (i.e. #if MANIFOLD_PAR == 'T' -> #ifdef MANIFOLD_PAR)

@pca006132
Copy link
Collaborator

btw maybe we should take the chance to change MANIFOLD_PAR to ON/OFF as well, we no longer have multiple backends anyway

Do you want to make it binary just in CMake, or also in the C++ source code? (i.e. #if MANIFOLD_PAR == 'T' -> #ifdef MANIFOLD_PAR)

Both.

@starseeker
Copy link
Contributor Author

By the way, should that .vscode directory be committed into the repo?

@elalish
Copy link
Owner

elalish commented Sep 28, 2024

By the way, should that .vscode directory be committed into the repo?

I've gotten this question before - I suppose the correct answer is no, but I did it intentionally because when I clone the repo on a new machine (and I'm always using VSCode - who isn't anymore?) it's really convenient to have it all automatically set up. Is it bothering anyone?

@pca006132
Copy link
Collaborator

By the way, should that .vscode directory be committed into the repo?

IMO no, I think people often use their own vscode config for the project anyway. @elalish what do you think?

@wtholliday
Copy link
Contributor

Is it bothering anyone?

I thought it was nice, because I'm not a regular vscode user (Xcode usually) and vscode automatically did the code formatting, which I assume is part of your config. Only issue I had was that cmake fails within vscode on my mac, which perhaps is a config issue?

[cmake] CMake Error: Error: generator : Ninja
[cmake] Does not match the generator used previously: Unix Makefiles
[cmake] Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

I blow away the whole build dir and get the same error. Works outside of vscode.

CMakeLists.txt Show resolved Hide resolved
include/manifold/tri_dist.h Outdated Show resolved Hide resolved
@elalish
Copy link
Owner

elalish commented Sep 28, 2024

@wtholliday Interesting, I'm not aware of Ninja being part of VSCode by default, but maybe something has changed?

@starseeker
Copy link
Contributor Author

About vec_view.h and iters.h - the former is referenced by cross_section.h, and the latter by parallel.h - that's why they got categorized as public headers, since cross_section.h and parallel.h are public? I can check if they're actually needed in those headers...

@starseeker
Copy link
Contributor Author

Is cross_section.h intended to be a public header? If so, it looks like vec_view.h needs to be too...

@elalish
Copy link
Owner

elalish commented Sep 29, 2024

Is cross_section.h intended to be a public header? If so, it looks like vec_view.h needs to be too...

Ah, I see. Yeah, parallel.h became public recently and I didn't realize it pulled in iter.h. And vec_view apparently came in to both cross_section and manifold.h with WarpBatch. Okay, I guess that's fine as is, thanks.

@elalish
Copy link
Owner

elalish commented Sep 29, 2024

Do we think this is ready to merge? If so I can update our CI so it's expecting these test runs.

@starseeker
Copy link
Contributor Author

Ah, I see. Yeah, parallel.h became public recently and I didn't realize it pulled in iter.h. And vec_view apparently came in to both cross_section and manifold.h with WarpBatch. Okay, I guess that's fine as is, thanks.

Oh, whoops - I make parallel.h non-public to hide iter.h. Should I put it back?

@starseeker
Copy link
Contributor Author

Is cross_section.h intended to be a public header? If so, it looks like vec_view.h needs to be too...

Ah, I see. Yeah, parallel.h became public recently and I didn't realize it pulled in iter.h. And vec_view apparently came in to both cross_section and manifold.h with WarpBatch. Okay, I guess that's fine as is, thanks.

OK, I put iter.h and parallel.h back. As far as I know this can be merged, as long as nobody else has spotted any issues. It'll probably be easier to do any additional refinements in other pull requests in any case.

Per suggestion from pca006132, changed CMake logic to be ON/OFF, and
simplified the C++ defines to test for defined/undefined vs. checking
for a specific value.
parallel.h was apparently specifically public - undo hiding of iter.h

This reverts commit ce3e45a.
parallel.h was apparently specifically public

This reverts commit 08fbcdf.
@starseeker
Copy link
Contributor Author

Rebased, corrected indenting on other CMakeLists.txt files. Assuming the adjustment to CMake spacing didn't inadvertently break something, that should be all I've got for this PR.

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - really glad to have your help cleaning up our CMake and structure.

@starseeker
Copy link
Contributor Author

Thanks - really glad to have your help cleaning up our CMake and structure.

My pleasure - thank you for being willing to do so! It makes life much easier for me updating to newer Manifold versions (I was doing some custom modding on my end prior to this) so it's a textbook win-win.

@elalish elalish merged commit 5cab42f into elalish:master Sep 29, 2024
21 checks passed
@starseeker starseeker deleted the reorg branch September 29, 2024 18:11
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