db58f9dd0827083441bd29dc46ed1df040343a36
[mono.git] / mono / metadata / CMakeLists.txt
1 if(HOST_WIN32)
2 ###win32_sources = \
3 ###     console-win32.c
4
5 ###platform_sources = $(win32_sources)
6
7 #### Use -m here. This will use / as directory separator (C:/WINNT).
8 #### The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
9 #### / by \ if running under WIN32.
10 ###if CROSS_COMPILING
11 ###assembliesdir = ${libdir}
12 ###confdir = ${sysconfdir}
13 ###else
14 ###assembliesdir = `cygpath -m "${libdir}"`
15 ###confdir = `cygpath -m "${sysconfdir}"`
16 ###endif
17 ###export HOST_CC
18 #### The mingw math.h has "extern inline" functions that dont appear in libs, so
19 #### optimisation is required to actually inline them
20 ###AM_CFLAGS = -O
21
22 else()
23
24 # FIXME:
25 set(assembliesdir ${CMAKE_INSTALL_PREFIX}/lib)
26 set(sysconfdir ${CMAKE_INSTALL_PREFIX}/etc)
27 set(confdir ${sysconfdir})
28 ###assembliesdir = $(exec_prefix)/lib
29 ###confdir = $(sysconfdir)
30
31 set(unix_sources
32   console-unix.c)
33
34 set(platform_sources ${unix_sources})
35
36 endif(HOST_WIN32)
37
38 ###bin_PROGRAMS = pedump
39
40 #
41 #### libtool is not capable of creating static/shared versions of the same
42 #### convenience lib, so we have to do it ourselves
43 #
44 ###noinst_LTLIBRARIES = libmonoruntime.la libmonoruntime-static.la
45
46 set(top_srcdir ../../)
47 INCLUDE_DIRECTORIES(${top_srcdir} ${top_srcdir}/mono ${GLIB2_INCLUDE_DIRS})
48 ADD_DEFINITIONS("-DMONO_BINDIR=\"${CMAKE_BINARY_DIR}\"")
49 ADD_DEFINITIONS("-DMONO_ASSEMBLIES=\"${assembliesdir}\"")
50 ADD_DEFINITIONS("-DMONO_CFG_DIR=\"${confdir}\"")
51 ADD_DEFINITIONS(${CFLAGS} ${LIBGC_CFLAGS} ${CPPFLAGS})
52
53 #
54 #### Make sure any prefix changes are updated in the binaries too.
55 #
56 ####  assembly.c uses MONO_ASSEMBLIES
57 ####  mono-config.c uses MONO_CFG_DIR
58 #
59 #### This won't result in many more false positives than AC_DEFINEing them
60 #### in configure.in.
61 #
62 ###assembly.lo mono-config.lo: Makefile
63
64 ###CLEANFILES = mono-bundle.stamp
65
66 ###libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
67
68 set(null_sources
69   console-null.c)
70
71 set(libmonoruntime_la_SOURCES
72         ${platform_sources}
73         appdomain.c     
74         assembly.c      
75         attach.h        
76         attach.c        
77         boehm-gc.c      
78         char-conversions.h
79         cil-coff.h      
80         class.c         
81         class-internals.h
82         cominterop.c    
83         cominterop.h    
84         console-io.h    
85         coree.c         
86         coree.h         
87         culture-info.h  
88         culture-info-tables.h
89         debug-helpers.c 
90         debug-mono-symfile.h
91         debug-mono-symfile.c
92         decimal.c       
93         decimal.h       
94         domain.c        
95         domain-internals.h
96         environment.c   
97         environment.h   
98         exception.c     
99         exception.h     
100         file-io.c       
101         file-io.h       
102         filewatcher.c   
103         filewatcher.h   
104         gc.c            
105         gc-internal.h   
106         generic-sharing.c
107         icall.c         
108         icall-def.h     
109         image.c         
110         loader.c        
111         locales.c       
112         locales.h       
113         lock-tracer.c   
114         lock-tracer.h   
115         marshal.c       
116         marshal.h       
117         mempool.c       
118         mempool-internals.h
119         metadata.c      
120         metadata-verify.c
121         metadata-internals.h
122         method-builder.h 
123         method-builder.c 
124         mono-config.c   
125         mono-debug.h    
126         mono-debug.c    
127         mono-debug-debugger.h
128         mono-debug-debugger.c
129         mono-endian.c   
130         mono-endian.h   
131         mono-mlist.c    
132         mono-mlist.h    
133         mono-perfcounters.c
134         mono-perfcounters.h
135         mono-perfcounters-def.h
136         monitor.c       
137         monitor.h       
138         normalization-tables.h
139         null-gc.c       
140         number-formatter.h
141         object.c        
142         object-internals.h
143         opcodes.c       
144         socket-io.c     
145         socket-io.h     
146         process.c       
147         process.h       
148         profiler.c      
149         profiler-private.h
150         rand.h          
151         rand.c          
152         reflection.c    
153         security.c      
154         security.h      
155         security-core-clr.c
156         security-core-clr.h
157         security-manager.c
158         security-manager.h
159         sgen-gc.c       
160         sgen-gc.h       
161         sgen-archdep.h
162         sgen-scan-object.h
163         string-icalls.c 
164         string-icalls.h 
165         sysmath.h       
166         sysmath.c       
167         tabledefs.h     
168         threads.c       
169         threads-types.h 
170         threadpool.c    
171         threadpool.h    
172         threadpool-internals.h
173         verify.c        
174         verify-internals.h
175         wrapper-types.h)
176
177 set(libmonoruntime_static_la_SOURCES ${libmonoruntime_la_SOURCES})
178
179 ###libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
180
181 ###libmonoruntimeinclude_HEADERS = \
182 ###     assembly.h              \
183 ###     attrdefs.h              \
184 ###     appdomain.h             \
185 ###     blob.h                  \
186 ###     class.h                 \
187 ###     debug-helpers.h         \
188 ###     debug-mono-symfile.h    \
189 ###     threads.h               \
190 ###     environment.h           \
191 ###     exception.h             \
192 ###     image.h                 \
193 ###     loader.h                \
194 ###     mempool.h               \
195 ###     metadata.h              \
196 ###     mono-config.h           \
197 ###     mono-debug.h            \
198 ###     mono-gc.h               \
199 ###     object.h                \
200 ###     opcodes.h               \
201 ###     profiler.h              \
202 ###     reflection.h            \
203 ###     row-indexes.h           \
204 ###     tokentype.h             \
205 ###     verify.h                
206
207 #ADD_LIBRARY(libmonoruntime SHARED ${libmonoruntime_la_SOURCES})
208
209 ###if DTRACE_G_REQUIRED
210
211 ###PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
212
213 ###pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
214 ###     DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
215 ###     --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
216
217 ###else
218 ###PEDUMP_DTRACE_OBJECT = 
219 ###endif
220
221 add_library(monoruntime-static STATIC ${libmonoruntime_static_la_SOURCES})
222 #add_library(monoruntime SHARED ${libmonoruntime_static_la_SOURCES})
223 #target_link_libraries(monoruntime wapi monoutils monogc ${GLIB2_LIBRARIES} ${LIBS})
224
225 # FIXME:
226 link_directories(../../libgc/.libs)
227 add_executable(pedump pedump.c)
228 target_link_libraries(pedump monoruntime-static wapi monoutils monogc-static ${GLIB2_LIBRARIES} ${LIBS})
229
230 ###pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
231 ###     $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
232
233 ###EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources)
234