gc icon indicating copy to clipboard operation
gc copied to clipboard

CMake config file

Open ssrlive opened this issue 5 years ago • 5 comments

CMake configure file ready.

ssrlive avatar Jan 07 '20 19:01 ssrlive

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

ssrlive avatar Jan 08 '20 08:01 ssrlive

@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 avatar Jan 15 '20 07:01 mkirchner

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.

mkirchner avatar Jan 15 '20 07:01 mkirchner

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.

mupfdev avatar Jun 24 '20 07:06 mupfdev

@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 avatar May 17 '22 11:05 mkirchner