[Gc] patch for cmake build system and a little warning disabler

Jack Andrews jack at sun.com
Mon Oct 20 05:59:28 PDT 2008


hi guys,

while it's not the prettiest tool, cmake generates makefiles
for different systems.  here's one i wrote for visual c on win.
it's quite short (compared to NT_THREAD_MAKEFILE) and
maintainable.

also a small pragma for some annoying warnings.

ta, jack.



Index: gc6.7/CMakeLists.txt
===================================================================
--- /dev/null
+++ gc6.7/CMakeLists.txt
@@ -0,0 +1,36 @@
+# (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 Project.sln
+#
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MD /W3 /EHsc /O2")
+ADD_DEFINITIONS(
+           "/D NDEBUG
+            /D SILENT
+            /D GC_BUILD
+            /D WIN32
+            /D _WINDOWS
+            /D ALL_INTERIOR_POINTERS
+            /D __STDC__
+            /D GC_WIN32_THREADS"
+)
+INCLUDE_DIRECTORIES(include)
+
+ADD_LIBRARY(gc SHARED
+ allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c dyn_load.c finalize.c
+ gc_cpp.cc headers.c mach_dep.c malloc.c mallocx.c mark.c mark_rts.c misc.c
+ new_hblk.c obj_map.c os_dep.c ptr_chck.c reclaim.c stubborn.c typd_mlc.c
+ win32_threads.c
+)
+
+ADD_EXECUTABLE(gctest WIN32 tests/test.c)
+TARGET_LINK_LIBRARIES(gctest gc)
+
+
+ADD_LIBRARY(de cord/cordbscs.c cord/cordxtra.c cord/de.c cord/de_win.c)
+TARGET_LINK_LIBRARIES(de gc)
Index: gc6.7/include/private/gc_priv.h
===================================================================
--- gc6.7.orig/include/private/gc_priv.h
+++ gc6.7/include/private/gc_priv.h
@@ -19,6 +19,10 @@
  # ifndef GC_PRIVATE_H
  # define GC_PRIVATE_H

+#ifdef MSWIN32
+#pragma warning(disable:4996)
+#endif
+
  #if defined(mips) && defined(SYSTYPE_BSD) && defined(sony_news)
      /* sony RISC NEWS, NEWSOS 4 */
  #   define BSD_TIME


More information about the Gc mailing list