Index: experimental/c-api-example/c.md |
diff --git a/experimental/c-api-example/c.md b/experimental/c-api-example/c.md |
index 89ad577bb439fa67401760a5a80622c0aac8e68c..12ffe096f784f96248efd588ebcba8fc58cc4441 100644 |
--- a/experimental/c-api-example/c.md |
+++ b/experimental/c-api-example/c.md |
@@ -108,36 +108,24 @@ Cmake example |
The following proof-of-concept workflow currently works on MacOS and Ubuntu |
-1. Aquire Skia (you may have already done this): |
+1. Aquire, compile, and install Skia as a shared library: |
<!--?prettify lang=sh?--> |
- cd [Wherever you want skia src code] |
- git clone 'https://skia.googlesource.com/skia' |
- SKIA_DIR="$PWD/skia" |
+ prefix="$HOME" # or /usr/local or wherever |
mtklein
2015/09/03 16:32:06
This seems too complicated to be a clear example.
hal.canary
2015/09/03 21:05:24
I like not depending on ninja.
I want to demonstr
|
+ cd $(mktemp -d "${TMPDIR:-/tmp}/skia.XXXXXXXXXX") |
+ git clone --depth 1 'https://skia.googlesource.com/skia' |
+ cmake -DCMAKE_INSTALL_PREFIX:PATH="$prefix" skia/cmake -G Ninja |
+ ninja skia |
+ ninja install |
-2. Compile Skia (outside of source) as a shared library: |
+2. Compile, link, and run the example program: |
- <!--?prettify lang=sh?--> |
- |
- cd [Wherever you want skia build files] |
- mkdir build_skia |
- cd build_skia |
- SKIA_BUILD="$PWD" |
- cmake "$SKIA_DIR/cmake" -G Ninja && ninja |
- |
-3. Compile, link, and run the example program: |
- |
- <!--?prettify lang=sh?--> |
+ <!--?prettify lang=sh?-->hal2 |
mtklein
2015/09/03 16:32:06
hal2?
hal.canary
2015/09/03 21:05:23
argh! that's the name of an emacs macro I have!
|
- cd [Wherever you want the example] |
- mkdir skia_c_example |
- cd skia_c_example |
- cp "$SKIA_DIR/experimental/c-api-example/skia-c-example.c" . |
- cc -c -I "$SKIA_DIR/include/c" skia-c-example.c -o skia-c-example.o |
- c++ skia-c-example.o \ |
- "$SKIA_BUILD"/libskia.* -Wl,-rpath -Wl,"$SKIA_BUILD" \ |
- -o skia-c-example |
+ cc -o skia-c-example -I "$prefix/include" \ |
mtklein
2015/09/03 16:32:06
Similarly,
cc -o skia-c-example ../experimental/c
|
+ skia/experimental/c-api-example/skia-c-example.c \ |
+ "$prefix"/lib/libskia.* -Wl,-rpath -Wl,"$prefix/lib" |
./skia-c-example |
- [ $(uname) = Darwin ] && open skia-c-example.png |
- [ $(uname) = Linux ] && xdg-open skia-c-example.png |
+ [ $(uname) = Darwin ] && open skia-c-example.png |
+ [ $(uname) = Linux ] && xdg-open skia-c-example.png |