summaryrefslogtreecommitdiff
path: root/portaudio/bindings/cpp/SConscript
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-25 14:54:53 -0500
committersanine <sanine.not@pm.me>2022-08-25 14:54:53 -0500
commit37c97e345d12f95dde44e1d1a4c2f2aadd4615bc (patch)
treee1bb25bc855883062bdd7847ff2c04290f71c840 /portaudio/bindings/cpp/SConscript
parent5634c7b04da619669f2f29f6798c03982be05180 (diff)
add initial structure
Diffstat (limited to 'portaudio/bindings/cpp/SConscript')
-rw-r--r--portaudio/bindings/cpp/SConscript65
1 files changed, 65 insertions, 0 deletions
diff --git a/portaudio/bindings/cpp/SConscript b/portaudio/bindings/cpp/SConscript
new file mode 100644
index 0000000..e69b93a
--- /dev/null
+++ b/portaudio/bindings/cpp/SConscript
@@ -0,0 +1,65 @@
+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"
+ if Platform != 'darwin':
+ 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)
+
+headers = Split("""AutoSystem.hxx
+ BlockingStream.hxx
+ CallbackInterface.hxx
+ CallbackStream.hxx
+ CFunCallbackStream.hxx
+ CppFunCallbackStream.hxx
+ Device.hxx
+ DirectionSpecificStreamParameters.hxx
+ Exception.hxx
+ HostApi.hxx
+ InterfaceCallbackStream.hxx
+ MemFunCallbackStream.hxx
+ PortAudioCpp.hxx
+ SampleDataFormat.hxx
+ Stream.hxx
+ StreamParameters.hxx
+ SystemDeviceIterator.hxx
+ SystemHostApiIterator.hxx
+ System.hxx
+ """)
+if env["PLATFORM"] == "win32":
+ headers.append("AsioDeviceAdapter.hxx")
+headers = [File(os.path.join("include", "portaudiocpp", h)) for h in headers]
+
+Return("sharedLibs", "staticLibs", "headers")