/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to meson.build

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-07 22:32:25 UTC
  • mfrom: (151.1.2 simpletypesystem_meson)
  • Revision ID: gustav.hartvigsson@gmail.com-20210107223225-4i46581v09jkt7tr
* Merged lp:~gustav-hartvigsson/simpletypesystem/meson

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project ('LibSSTS', 'c',
 
2
         default_options : ['c_std=gnu18'],
 
3
         version : '0.0.1',
 
4
         license : 'MIT')
 
5
 
 
6
 
 
7
conf = configuration_data ()
 
8
 
 
9
version_array = meson.project_version ().split ('.')
 
10
 
 
11
conf.set ('SSTS_V_MAJOR', version_array[0].to_int ())
 
12
conf.set ('SSTS_V_MINOR', version_array[1].to_int ())
 
13
conf.set ('SSTS_V_PATCH', version_array[2].to_int ())
 
14
 
 
15
conf.set ('DEBUG', 'ON')
 
16
conf.set ('S_USE_GC', 'ON')
 
17
conf.set ('SSTS_BUILDING', 'ON')
 
18
 
 
19
ssts_project_root = meson.source_root()
 
20
 
 
21
 
 
22
cc = meson.get_compiler ('c')
 
23
 
 
24
pthread_dep = dependency ('threads',required : false)
 
25
mthreads_dep = cc.find_library ('mthreads', required : false)
 
26
# Need to figure out how to get if Boehm GC is included or not...
 
27
boehm_dep = cc.find_library ('gc', required : false)
 
28
# This will always exist, but we need to specify it anyways, Not needed on
 
29
# Windows, it seems, as it is part of the standard library.
 
30
mathlib_dep = cc.find_library ('m', required : false)
 
31
 
 
32
if mthreads_dep.found ()
 
33
  conf.set ('HAVE_MTHREAD', 'ON')
 
34
  conf.set ('HAVE_PTHREAD', 'OFF')
 
35
  add_global_arguments('-mthread', language : 'c')
 
36
elif pthread_dep.found ()
 
37
  conf.set ('HAVE_MTHREAD', 'OFF')
 
38
  conf.set ('HAVE_PTHREAD', 'ON')
 
39
  add_global_arguments('-pthread', language : 'c')
 
40
else
 
41
  conf.set ('HAVE_MTHREAD', 'OFF')
 
42
  conf.set ('HAVE_PTHREAD', 'OFF')
 
43
endif
 
44
 
 
45
subdir ('libssts')
 
46