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

CMake config file #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

CMake config file #41

wants to merge 3 commits into from

Conversation

ssrlive
Copy link
Contributor

@ssrlive ssrlive commented Jan 7, 2020

CMake configure file ready.

Copy link
Owner

@mkirchner mkirchner left a comment

Choose a reason for hiding this comment

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

Can we also add test and coverage targets? That would be necessary if we want to replace the GNU Makefiles.

@ssrlive
Copy link
Contributor Author

ssrlive commented Jan 8, 2020

I don't know how to do that. Can you continue the work?

@mkirchner
Copy link
Owner

@ssrlive commented on the current CMake support status in #48; I am moving this here since there is no official CMake support in gc and any existing issues w/ CMake support are related to this PR.

Here is the comment:

test it on Windows / Linux / macOS, all the Release buildings are failed.

ssrlive@ss:~/Desktop/gc/build$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(gc C)

set(CMAKE_C_STANDARD 11)

include_directories(src)
include_directories(test)

add_executable(gc
        src/gc.h
        src/log.c
        src/log.h
        test/minunit.h
        test/test_gc.c)
ssrlive@ss:~/Desktop/gc/build$ cmake .. -DCMAKE_BUILD_TYPE=Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ssrlive/Desktop/gc/build
ssrlive@ss:~/Desktop/gc/build$ make
[100%] Built target gc
ssrlive@ss:~/Desktop/gc/build$ ./gc
---=[ GC tests
Heap allocation referenced from stack should be tagged
Tests run: 5

@mkirchner
Copy link
Owner

Also @ssrlive , I can't provide CMake support. The GNU make solution works fine. I am happy to merge a working CMakeList.txt, but as I mentioned earlier, I will require it to support build, text and coverage runs in order to accept the PR.

If that continues to be an issue for you, I am also happy to open a ticket that asks for CMake support and to tag it with a help-wanted tag.

@mupfdev
Copy link

mupfdev commented Jun 24, 2020

Couldn't you provide this CMakeLists.txt besides the regular Makefile? There's no harm in having both, even though CMake can generate a Makefile, you usually don't do this within the project directory.

Having CMake support would make it much easier to integrate gc into other projects e.g. using git submodules.

@mkirchner
Copy link
Owner

@mupfdev, misunderstanding: as mentioned in the previous comment I'd be happy to merge a CMakeLists.txt to this project but it would need to have feature parity with the existing Makefile.

@mkirchner mkirchner added good first issue Good for newcomers help wanted Extra attention is needed labels May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants