File: SConscript

package info (click to toggle)
flightgear 1%3A2020.3.19%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 51,068 kB
  • sloc: cpp: 245,588; ansic: 181,318; sh: 13,686; perl: 4,475; python: 3,139; xml: 899; asm: 642; makefile: 347; java: 314
file content (41 lines) | stat: -rw-r--r-- 1,673 bytes parent folder | download | duplicates (7)
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
import os.path

Import("env", "buildDir")
env.Append(CPPPATH="include")

ApiVer = "0.0.12"
Major, Minor, Micro = [int(c) for c in ApiVer.split(".")]

sharedLibs = []
staticLibs = []
Import("Platform", "Posix")
if Platform in Posix:
    env["SHLIBSUFFIX"] = ".so.%d.%d.%d" % (Major, Minor, Micro)
    soFile = "libportaudiocpp.so"
    env.AppendUnique(SHLINKFLAGS="-Wl,-soname=%s.%d" % (soFile, Major))

    # Create symlinks
    def symlink(env, target, source):
        trgt = str(target[0])
        src = str(source[0])
        if os.path.islink(trgt) or os.path.exists(trgt):
            os.remove(trgt)
        os.symlink(os.path.basename(src), trgt)
    lnk0 = env.Command(soFile + ".%d" % (Major), soFile + ".%d.%d.%d" % (Major, Minor, Micro), symlink)
    lnk1 = env.Command(soFile, soFile + ".%d" % (Major), symlink)
    sharedLibs.append(lnk0)
    sharedLibs.append(lnk1)

src = [os.path.join("source", "portaudiocpp", "%s.cxx" % f) for f in ("BlockingStream", "CallbackInterface", \
    "CallbackStream", "CFunCallbackStream","CppFunCallbackStream", "Device",
    "DirectionSpecificStreamParameters", "Exception", "HostApi", "InterfaceCallbackStream",
    "MemFunCallbackStream", "Stream", "StreamParameters", "System", "SystemDeviceIterator",
    "SystemHostApiIterator")]
env.Append(LIBS="portaudio", LIBPATH=buildDir)
sharedLib = env.SharedLibrary("portaudiocpp", src, LIBS=["portaudio"])
staticLib = env.Library("portaudiocpp", src, LIBS=["portaudio"])
sharedLibs.append(sharedLib)
staticLibs.append(staticLib)
from glob import glob
headers = [File(f) for f in glob(os.path.join("include", "portaudiocpp", "*"))]
Return("sharedLibs", "staticLibs", "headers")