summaryrefslogtreecommitdiffstats
path: root/gears/SConscript.portaudio
blob: f0537632f0d17e902dfad1b5b6342e882fdbef20 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright (c) 2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Import('env')

env = env.Clone(
)

env.Replace(
    PA_DIR = '$THIRD_PARTY_DIR/portaudio',
    CPPPATH = [
        '$PA_DIR/include',
        '$PA_DIR/src/common',
        '$VC80_CPPPATH',
    ],
)

env.Append(
    CPPDEFINES = [
        'PA_NO_DS',
        'PA_NO_ASIO',
    ],
)

if env['OS'] in ['win32', 'wince']:
  env.Append(
      CPPPATH = [
          '$PA_DIR/src/os/win',
      ],
      CPPFLAGS = [
          '/wd4133',
          '/wd4101',
      ],
  )
elif env['OS'] == 'linux':
  env.Append(
      CPPPATH = [
          '$PA_DIR/src/os/unix',
      ],
      CPPFLAGS = [
# disable some warnings
          '-Wno-unused-variable',
# enable multithreading support with pthread library
          '-pthread',
      ],
      CPPDEFINES = [
# build only the OSS hostapi for linux
          'PA_USE_OSS',
          'HAVE_SYS_SOUNDCARD_H=1',
      ],
  )
elif env['OS'] == 'osx':
  env.Append(
      CPPPATH = [
          '$PA_DIR/src/hostapi/coreaudio',
          '$PA_DIR/src/hostapi/mac_osx',
          '$PA_DIR/src/os/unix',
      ],
      CPPFLAGS = [
# disable some warnings
          '-Wno-unused-variable',
          '-Wno-uninitialized',
      ],
      CPPDEFINES = [
          'PA_USE_COREAUDIO',
      ],
  )

input_files = [
    '$PA_DIR/src/common/pa_allocation.c',
    '$PA_DIR/src/common/pa_converters.c',
    '$PA_DIR/src/common/pa_cpuload.c',
    '$PA_DIR/src/common/pa_debugprint.c',
    '$PA_DIR/src/common/pa_dither.c',
    '$PA_DIR/src/common/pa_front.c',
    '$PA_DIR/src/common/pa_process.c',
    '$PA_DIR/src/common/pa_skeleton.c',
    '$PA_DIR/src/common/pa_stream.c',
    '$PA_DIR/src/common/pa_trace.c',
]

# Platform-specific inputs
if env['OS'] in ['win32', 'wince']:
  input_files += [
    '$PA_DIR/src/hostapi/wmme/pa_win_wmme.c',
    '$PA_DIR/src/os/win/pa_win_hostapis.c',
    '$PA_DIR/src/os/win/pa_win_util.c',
    '$PA_DIR/src/os/win/pa_win_waveformat.c',
  ]
elif env['OS'] == 'linux':
  input_files += [
    '$PA_DIR/src/hostapi/oss/pa_unix_oss.c',
    '$PA_DIR/src/os/unix/pa_unix_hostapis.c',
    '$PA_DIR/src/os/unix/pa_unix_util.c',
  ]
elif env['OS'] == 'osx':
  input_files += [
    '$PA_DIR/src/common/pa_ringbuffer.c',
    '$PA_DIR/src/hostapi/coreaudio/pa_mac_core.c',
    '$PA_DIR/src/hostapi/coreaudio/pa_mac_core_blocking.c',
    '$PA_DIR/src/hostapi/coreaudio/pa_mac_core_utilities.c',
    '$PA_DIR/src/os/mac_osx/pa_mac_hostapis.c',
    '$PA_DIR/src/os/unix/pa_unix_util.c',
  ]

env.GearsStaticLibrary('portaudio', input_files)