aboutsummaryrefslogtreecommitdiff
path: root/libbutl/buildfile
blob: f2674ffd41606c79b35ffe8635cc7db48f0e745f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# file      : libbutl/buildfile
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

lib{butl}: {hxx ixx txx cxx}{** -win32-utility -version} {hxx}{version}

# Exclude these from compilation on non-Windows targets.
#
if ($cxx.target.class == "windows")
  lib{butl}: {hxx cxx}{win32-utility}
else
  lib{butl}: file{win32-utility.?xx}

# The C-files are included into sha256.cxx (sha256c.c) and timestamp.cxx
# (strptime.c timelocal.h timelocal.c), so treat them as files to exclude from
# the compilation.
#
# @@ Change to 'file{*.c *.h}' when supported.
#
lib{butl}: file{*.c +*.h}

hxx{version}: in{version} $src_root/file{manifest}
hxx{version}: dist = true

# For pre-releases use the complete version to make sure they cannot be used
# in place of another pre-release or the final version.
#
if $version.pre_release
  lib{butl}: bin.lib.version = @"-$version.project_id"
else
  lib{butl}: bin.lib.version = @"-$version.major.$version.minor"

bmi{*}: cxx.poptions += -DLIBBUTL_MODULE_BUILD

cxx.poptions =+ "-I$out_root" "-I$src_root"
obja{*} bmia{*}: cxx.poptions += -DLIBBUTL_STATIC_BUILD
objs{*} bmis{*}: cxx.poptions += -DLIBBUTL_SHARED_BUILD

lib{butl}: cxx.export.poptions = "-I$out_root" "-I$src_root"
liba{butl}: cxx.export.poptions += -DLIBBUTL_STATIC
libs{butl}: cxx.export.poptions += -DLIBBUTL_SHARED

if ($cxx.target.class == "windows")
{
  if ($cxx.target.system == "mingw32")
    cxx.libs += -limagehlp
  else
    cxx.libs += imagehlp.lib
}
else
  cxx.libs += -lpthread

# Install into the libbutl/ subdirectory of, say, /usr/include/.
#
install.include = $install.include/libbutl/
install.include.subdirs = true # Recreate subdirectories.