Skip to content

Conversation

@thomasfsteeples
Copy link

Added CMake support. Created new src and include directories to help facilitate this. Updated meson.build and Makefile to reflect new directory structure. Updated README.md to explain how to integrate µnit into a project using CMake.

…facilitate this. Updated meson.build and Makefile to reflect new directory structure. Updated README.md to explain how to integrate µnit into a project using CMake.
Copy link
Owner

@nemequ nemequ left a comment

Choose a reason for hiding this comment

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

I'm okay with adding CMake support, but I don't want to rename the files since it would break existing code… If you're willing to rework this a bit so munit.{c,h} aren't renamed I'd be happy to merge it.

@hungrybluedev
Copy link

I'm currently using µnit in my project which is built with CMake, and I'll be delighted if this PR gets merged.

I agree with @nemequ with the fact that it would be better to keep the source files in the root to retain support for existing codebases. It might not be the most aesthetic thing to keep the sources outside src but we can make an exception here because there aren't a lot of source files in this project.

@thomasfsteeples
Copy link
Author

@nemequ, that sounds reasonable. I've put the source/include files back in their original locations. Let me know if you would like anything else changed.

@codylico
Copy link

I notice that the CMake file hard-codes munit to build in Release mode. Is that the intent?
See line 28 of CMakeLists.txt.

@thomasfsteeples
Copy link
Author

I notice that the CMake file hard-codes munit to build in Release mode. Is that the intent?
See line 28 of CMakeLists.txt.

So this was intentional, but happy to change this if the consensus is that this isn't sane.

@codylico
Copy link

I am okay with hard-coded Release mode in this case. Anyone else have thoughts?

@ghost
Copy link

ghost commented Jun 22, 2021

@thomasfsteeples I have written a CMake module along with a helper cmake file with function munit_dicover_tests that could be used to automatically discovering test case from any CMake test target that uses Munit for unit testing, just like gtest_dicover_tests in GoogleTest CMake module in this gist. For more info, see issue #76.

The files in this gist could be useful for inclusion in this PR to simplify the usage of CMake with Munit.

@evo-i
Copy link

evo-i commented Jun 11, 2024

It was too bad to change the c standard and use some kind of flags for global, can break existing code which include this project with itself. Check pr with #100

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.

5 participants