[Gc] CMake patch (alternate build system on windows)

Boehm, Hans hans.boehm at hp.com
Wed Oct 29 10:02:03 PST 2008


Thanks.

Was this tested with something close to the current CVS tree, e.g. 7.1?  I'm concerned about libatomic_ops handling.

It might be good to also include the pthread- and darwin-specific source files.  I believe they're sufficiently ifdef-guarded that they introduce no code on Windows.  And it might make this closer to usable on other platforms as well.

I'd be happy to include it in the distribution if it works for 7.1 on Windows.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Jack Andrews
> Sent: Monday, October 27, 2008 10:13 PM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] CMake patch (alternate build system on windows)
>
> hi,
>
> all windows build targets taken care of by CMake!
>
>
> ta, jack
>
>
> Index: bdwgc/doc/README.win
> ===================================================================
> --- /dev/null
> +++ bdwgc/doc/README.win
> @@ -0,0 +1,42 @@
> +
> +CMAKE
> +-----
> +
> +Binaries (both 32- and 64-bit) can be built using CMake.
> CMake is an
> +open-source tool like automake - it generates makefiles.
> +
> +
> +CMake will generate:
> +
> +  Borland Makefiles
> +  MSYS Makefiles
> +  MinGW Makefiles
> +  NMake Makefiles
> +  Unix Makefiles
> +  . Visual Studio project files
> +    Visual Studio 6
> +    Visual Studio 7
> +    Visual Studio 7 .NET 2003
> +    Visual Studio 8 2005
> +    Visual Studio 8 2005 Win64
> +    Visual Studio 9 2008
> +    Visual Studio 9 2008 Win64
> +  Watcom WMake
> +
> +
> +BUILD PROCESS
> +-------------
> +
> + . install cmake (cmake.org)
> + . add directory containing cmake.exe to %PATH% . run cmake
> from the gc
> + root directory, passing the target with -G:
> +   eg.
> +      > cmake -G "Visual Studio 8 2005"
> +   use the gc.sln file genereated by cmake to build gc
> +
> +
> +INPUT
> +-----
> +
> +The main input to cmake are the CMakeLists.txt files in each
> directory.
> +For help, goto cmake.org.
> Index: bdwgc/CMakeLists.txt
> ===================================================================
> --- /dev/null
> +++ bdwgc/CMakeLists.txt
> @@ -0,0 +1,45 @@
> +# (C) Jack Andrews 2008
> +# licensed under GPL 2.0
> +#
> +#  get cmake and run:
> +#    cmake -G "Visual Studio 8 2005"
> +#  in the same dir as this file
> +#  this will generate gc.sln
> +#
> +
> +PROJECT(gc)
> +
> +ADD_DEFINITIONS("-D_CRT_SECURE_NO_DEPRECATE
> +                 -D__STDC__
> +                 -DALL_INTERIOR_POINTERS
> +                 -DGC_BUILD
> +")
> +
> +INCLUDE_DIRECTORIES(include)
> +
> +SET(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c
> +        mark_rts.c headers.c mark.c obj_map.c blacklst.c finalize.c
> +        new_hblk.c dbg_mlc.c malloc.c stubborn.c dyn_load.c
> +        typd_mlc.c ptr_chck.c gc_cpp.cc mallocx.c checksums.c
> +        win32_threads.c)
> +
> +ADD_LIBRARY(          gc-lib   STATIC      ${SRC})
> +SET_TARGET_PROPERTIES(gc-lib   PROPERTIES
> +                      COMPILE_DEFINITIONS -DGC_NOT_DLL)
> +
> +ADD_LIBRARY(          gcmt-lib STATIC      ${SRC})
> +SET_TARGET_PROPERTIES(gcmt-lib PROPERTIES
> +                      COMPILE_DEFINITIONS -DGC_THREADS
> +                      COMPILE_DEFINITIONS -DGC_NOT_DLL)
> +
> +ADD_LIBRARY(          gcmt-dll  SHARED     ${SRC})
> +SET_TARGET_PROPERTIES(gcmt-dll  PROPERTIES
> +                      COMPILE_DEFINITIONS -DGC_THREADS)
> +
> +ADD_EXECUTABLE(cord WIN32
> +               cord/cordbscs.c cord/cordxtra.c cord/de.c
> cord/de_win.c)
> +SET_TARGET_PROPERTIES(cord    PROPERTIES
> +                      COMPILE_DEFINITIONS -DGC_NOT_DLL)
> +TARGET_LINK_LIBRARIES(cord gc-lib)
> +
> +ADD_SUBDIRECTORY(tests)
> Index: bdwgc/tests/CMakeLists.txt
> ===================================================================
> --- /dev/null
> +++ bdwgc/tests/CMakeLists.txt
> @@ -0,0 +1,6 @@
> +# (C) Jack Andrews 2008
> +# licensed under GPL 2.0
> +
> +ADD_DEFINITIONS(-DGC_NOT_DLL)
> +ADD_EXECUTABLE(gctest WIN32 test.c)
> +TARGET_LINK_LIBRARIES(gctest gc-lib)
>



More information about the Gc mailing list