From 5f9487deb07aca04ae94b9e6284d6b9a0013c639 Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Sun, 9 Apr 2017 15:40:25 +1000 Subject: [PATCH] Add PublicUtility to manual build instructions and... ...make them less likely to fail because of permissions errors. --- DEVELOPING.md | 17 +++++++++++++++-- MANUAL-INSTALL.md | 18 +++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index 74c742c..f7a854c 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -102,11 +102,14 @@ real-time safe. To test your changes, build `Background Music Device.driver`, either inside Xcode (set the active scheme to "BGMDevice", go `Product > Build For > Running` and look in the `products` folder) or with something like ```shell +xcodebuild -project BGMDriver/BGMDriver.xcodeproj -target "PublicUtility" -configuration Debug xcodebuild -project BGMDriver/BGMDriver.xcodeproj -configuration Debug ``` And then run `BGMDriver/BGMDriver/quick_install.sh` to install. Or if you'd rather install manually, copy `Background Music Device.driver` to `/Library/Audio/Plug-Ins/HAL` and restart coreaudiod. +You might have to delete `BGMDriver/build` first if you're using `xcodebuild` and run into permissions problems. + Before you build, Xcode might show incorrect warnings on the `#pragma clang assume_nonnull` lines for some reason. They go away after you build and don't seem to cause any problems. @@ -191,12 +194,22 @@ From [main.m](BGMApp/BGMXPCHelper/main.m): ### Building -Build and run `Background Music.app` either inside Xcode or with something like +Build and install/run BGMXPCHelper and `Background Music.app` either inside Xcode or with something like ```shell -xcodebuild -project BGMApp/BGMApp.xcodeproj -configuration Debug +sudo xcodebuild -project BGMApp/BGMApp.xcodeproj \ + -target BGMXPCHelper \ + DSTROOT="/" \ + INSTALL_PATH="$(BGMApp/BGMXPCHelper/safe_install_dir.sh)" \ + -configuration Debug \ + install +sudo chown -R $(whoami):staff BGMApp/build # Fix build dir ownership +xcodebuild -project BGMApp/BGMApp.xcodeproj \ + -configuration Debug open "BGMApp/build/Debug/Background Music.app" ``` +You might have to delete `BGMApp/build` first if you're using `xcodebuild` and run into permissions problems. + To test with Address Sanitizer, you might have to set the environment var `ASAN_OPTIONS=detect_odr_violation=0` to work around [Issue #647](https://github.com/google/sanitizers/issues/647). (In Xcode, go `Product` > `Scheme` > `Edit Scheme...`, select the Background Music scheme, and add the environment var in Run > Arguments.) diff --git a/MANUAL-INSTALL.md b/MANUAL-INSTALL.md index f37d93d..af8ec4f 100644 --- a/MANUAL-INSTALL.md +++ b/MANUAL-INSTALL.md @@ -5,11 +5,15 @@ - Install the virtual audio device `Background Music Device.driver` to `/Library/Audio/Plug-Ins/HAL`. ```shell + sudo xcodebuild -project BGMDriver/BGMDriver.xcodeproj \ + -target "PublicUtility" \ + RUN_CLANG_STATIC_ANALYZER=0 \ + clean build sudo xcodebuild -project BGMDriver/BGMDriver.xcodeproj \ -target "Background Music Device" \ RUN_CLANG_STATIC_ANALYZER=0 \ DSTROOT="/" \ - install + clean install ``` - Install the XPC helper. @@ -19,16 +23,16 @@ RUN_CLANG_STATIC_ANALYZER=0 \ DSTROOT="/" \ INSTALL_PATH="$(BGMApp/BGMXPCHelper/safe_install_dir.sh)" \ - install + clean install ``` - Install `Background Music.app` to `/Applications` (or wherever). ```shell - xcodebuild -project BGMApp/BGMApp.xcodeproj \ - -target "Background Music" \ - RUN_CLANG_STATIC_ANALYZER=0 \ - DSTROOT="/" \ - install + sudo xcodebuild -project BGMApp/BGMApp.xcodeproj \ + -target "Background Music" \ + RUN_CLANG_STATIC_ANALYZER=0 \ + DSTROOT="/" \ + clean install ``` - Restart `coreaudiod`:
(Audio will stop working until the next step, so you might want to pause any running audio apps.)