8000 Add a cmake option for CrossSection by cjmayo · Pull Request #888 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a cmake option for CrossSection #888

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

Merged
merged 9 commits into from
Aug 13, 2024
Merged

Conversation

cjmayo
Copy link
Contributor
@cjmayo cjmayo commented Aug 8, 2024

On by default.

@cjmayo

This comment was marked as resolved.

Copy link
codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.17%. Comparing base (d437097) to head (889dd17).
Report is 73 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #888      +/-   ##
==========================================
- Coverage   91.84%   87.17%   -4.67%     
==========================================
  Files          37       66      +29     
  Lines        4976     9430    +4454     
  Branches        0     1033    +1033     
==========================================
+ Hits         4570     8221    +3651     
- Misses        406     1209     +803     

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

@cjmayo
Copy link
Contributor Author
cjmayo commented Aug 10, 2024

Tests pass now.

CMakeLists.txt Outdated
option(MANIFOLD_EXCEPTIONS "Build manifold with exception enabled" ON)
option(BUILD_SHARED_LIBS "Build shared library" ON)
include(CMakeDependentOption)
cmake_dependent_option(MANIFOLD_TEST "Enable testing suite" ON "MANIFOLD_CROSS_SECTION" OFF)
Copy link
Owner

Choose a reason for hiding this comment

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

This is new cmake syntax to me. What does it mean? It looks like cross section defaults to off, but I assume I'm wrong?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This means MANIFOLD_TEST is only enabled when MANIFOLD_CROSS_SECTION is ON. I think this is a bit too strong.

Copy link
Owner

Choose a reason for hiding this comment

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

Okay, I can see why that was chosen though. I wonder how many #ifdefs we'll have to add to get it to run? May be a good idea to rearrange the tests a bit to put anything requiring CrossSection near each other.

@pca006132
Copy link
Collaborator

I think we can run most of our tests when CrossSection is disabled.

@cjmayo
Copy link
Contributor Author
cjmayo commented Aug 12, 2024

Updated to allow compatible tests to run.

set(SOURCE_FILES test_main.cpp polygon_test.cpp sdf_test.cpp boolean_test.cpp)

if(MANIFOLD_CROSS_SECTION)
list(APPEND SOURCE_FILES boolean_complex_test.cpp cross_section_test.cpp hull_test.cpp manifold_test.cpp properties_test.cpp samples_test.cpp smooth_test.cpp)
Copy link
Owner

Choose a reason for hiding this comment

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

How many of the tests in these files actually require cross section? I can see skipping cross_section_test.cpp, but it feels a bit like throwing the baby out with the bathwater to remove all of these. Can we just #ifdef around a few tests in each file?

@cjmayo
Copy link
Contributor Author
cjmayo commented Aug 13, 2024

Added the ifdef's, and a CI job to test without CrossSection (had to split the Python tests into a separate step) - 232 tests out of 250 are still run.

(CI job name updated too to try and make the different runs clear)

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 updating the CI!

@elalish elalish merged commit e26e01a into elalish:master Aug 13, 2024
22 checks passed
@cjmayo cjmayo deleted the cross_section branch August 14, 2024 18:22
@elalish
Copy link
Owner
elalish commented Aug 20, 2024

Oops, @cjmayo it looks like we missed something. We were running 261 tests before, but from this PR on we're only running 250, even with MANIFOLD_CROSS_SECTION enabled. It appears CMake has successfully discovered the flag, but the corresponding #ifdefs are still false in the tests. Any idea what's wrong?

@pca006132
Copy link
Collaborator

Ah, we need to pass the definition to c++. https://cmake.org/cmake/help/latest/command/target_compile_definitions.html

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.

3 participants
0