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

Jack Andrews effbiae at gmail.com
Mon Oct 27 21:12:35 PST 2008


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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake
Type: application/octet-stream
Size: 2992 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/gc/attachments/20081028/3cc011a5/cmake.obj


More information about the Gc mailing list