diff options
author | halcanary <halcanary@google.com> | 2015-09-01 13:37:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-01 13:37:02 -0700 |
commit | e212789b0881698dc58158af903d1dd123d22dd8 (patch) | |
tree | 9087d9b9ce49b87d3c8d55de764a8c21b64a4945 /experimental/c-api-example | |
parent | 0e050c6620aab1d55c9398a9dedc10e594d4642c (diff) |
Experimental: document that cmake + c api example now works in Ubuntu.
NOTRY=true
TBR=
Review URL: https://codereview.chromium.org/1318823011
Diffstat (limited to 'experimental/c-api-example')
-rw-r--r-- | experimental/c-api-example/c.md | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/experimental/c-api-example/c.md b/experimental/c-api-example/c.md index ce2228995e..4566b94a4c 100644 --- a/experimental/c-api-example/c.md +++ b/experimental/c-api-example/c.md @@ -103,6 +103,8 @@ Here is an example program that uses the C api. To try it out, get the file <a href="https://fiddle.skia.org/c/6c6c01438d9c3d80e9c22e606359432e"><img src="https://fiddle.skia.org/i/6c6c01438d9c3d80e9c22e606359432e_raster.png" alt=""></a> +<!-- + Gyp+Linux example ----------------- @@ -135,13 +137,14 @@ The following proof-of-concept workflow currently works on Ubuntu 14.04: cc skia-c-example.o -L "$SKIA_DIR/out/Release/lib" -lskia -o skia-c-example LD_LIBRARY_PATH="$SKIA_DIR/out/Release/lib" ./skia-c-example xdg-open skia-c-example.png +--> -Cmake+MacOS example -------------------- +Cmake example +------------- -The following proof-of-concept workflow currently works on MacOS +The following proof-of-concept workflow currently works on MacOS and Ubuntu -1. Aquire Skia and install dependencies (you may have already done this): +1. Aquire Skia (you may have already done this): <!--?prettify lang=sh?--> @@ -149,7 +152,7 @@ The following proof-of-concept workflow currently works on MacOS git clone 'https://skia.googlesource.com/skia' SKIA_DIR="$PWD/skia" -2. Compile Skia as a shared library: +2. Compile Skia (outside of source) as a shared library: <!--?prettify lang=sh?--> @@ -164,10 +167,13 @@ The following proof-of-concept workflow currently works on MacOS <!--?prettify lang=sh?--> 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 ./skia-c-example - open skia-c-example.png + [ $(uname) = Darwin ] && open skia-c-example.png + [ $(uname) = Linux ] && xdg-open skia-c-example.png |