Skip to content

Added CMake support.#66

Open
thomasfsteeples wants to merge 6 commits into
nemequ:masterfrom
thomasfsteeples:master
Open

Added CMake support.#66
thomasfsteeples wants to merge 6 commits into
nemequ:masterfrom
thomasfsteeples:master

Conversation

@thomasfsteeples

Copy link
Copy Markdown

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.

@nemequ nemequ left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

@ghost

ghost commented Jun 22, 2021

Copy link
Copy Markdown

@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

evo-i commented Jun 11, 2024

Copy link
Copy Markdown

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