Add PublicUtility to manual build instructions and...

...make them less likely to fail because of permissions errors.
This commit is contained in:
Kyle Neideck 2017-04-09 15:40:25 +10:00
parent 6a26afe47a
commit 5f9487deb0
No known key found for this signature in database
GPG key ID: CAA8D9B8E39EC18C
2 changed files with 26 additions and 9 deletions

View file

@ -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.)

View file

@ -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`: <br>
(Audio will stop working until the next step, so you might want to pause any running audio apps.)