Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2709)

Unified Diff: experimental/fiddle/Makefile

Issue 1349163003: experiment/fiddle (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: experimental/fiddle/Makefile
diff --git a/experimental/fiddle/Makefile b/experimental/fiddle/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..42f86b44968f39fd880631e1facc9db92936ec4c
--- /dev/null
+++ b/experimental/fiddle/Makefile
@@ -0,0 +1,60 @@
+# Copyright 2015 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+.PHONEY: all
+all: fiddle
+clean:
+ git clean -fXd
+
+PREFIX ?= $(PWD)/local
+CXX ?= c++
+
+CXXFLAGS += -Wall -Werror --std=c++11
mtklein 2015/09/17 13:58:22 Why do we -Wall -Werror?
+LIBSKIA := libskia.so
+ifeq ($(shell uname), Darwin)
+ LIBSKIA := libskia.dylib
+endif
+
+# These commands also put headers in $(PREFIX)/include/skia.
+$(PREFIX)/lib/$(LIBSKIA):
+ mkdir -p build $(PREFIX)
+ cmake -DCMAKE_INSTALL_PREFIX:PATH="$(PREFIX)" -DSK_MESA:BOOL=1 \
+ -Bbuild -H../../cmake -G Ninja
+ ninja -C build skia
+ ninja -C build install
mtklein 2015/09/17 13:58:22 I'm skeptical of all these different directories a
+
+.PHONEY: libskia
+libskia: $(PREFIX)/lib/$(LIBSKIA)
+
+skia.h: headers.sh $(PREFIX)/lib/$(LIBSKIA)
+ sh headers.sh > skia.h
+
+SKIA_INCLUDES := \
+ -I $(PREFIX)/include/skia/core \
+ -I $(PREFIX)/include/skia/gpu \
+ -I $(PREFIX)/include/skia/gpu/gl \
+ -I $(PREFIX)/include/skia/effects \
+ -I $(PREFIX)/include/skia/pathops \
+ -I $(PREFIX)/include/skia/c \
+ -I $(PREFIX)/include/skia/utils
+
+# Precompiled header
+skia.gch: skia.h
mtklein 2015/09/17 13:58:22 Does this cut build times down significantly? I a
+ $(CXX) $(CXXFLAGS) $(SKIA_INCLUDES) -c $< -o $@
+
+OSMesaContextHolder.o: OSMesaContextHolder.cpp OSMesaContextHolder.h
+ $(CXX) $(CXXFLAGS) -c -o $@ OSMesaContextHolder.cpp
+
+fiddle_main.o: fiddle_main.cpp fiddle_main.h skia.gch OSMesaContextHolder.h
+ $(CXX) $(CXXFLAGS) $(SKIA_INCLUDES) -include skia.h -c -o $@ $<
mtklein 2015/09/17 13:58:22 Don't we need to name it skia.h.gch for this to wo
+
+################################################################################
+
+FIDDLE_LD := -lOSMesa -Wl,-rpath -Wl,"$(PREFIX)/lib"
mtklein 2015/09/17 13:58:22 Shouldn't Skia be linked against OSMesa instead?
+
+FIDDLE_SOURCES := draw.cpp fiddle_main.o OSMesaContextHolder.o $(PREFIX)/lib/$(LIBSKIA)
mtklein 2015/09/17 13:58:22 Why are fiddle_main and OSMesaContextHolder differ
+
+fiddle: $(FIDDLE_SOURCES) skia.gch fiddle_main.h
+ $(CXX) $(CXXFLAGS) $(SKIA_INCLUDES) -include skia.h -o $@ $(FIDDLE_SOURCES) $(FIDDLE_LD)
mtklein 2015/09/17 13:58:22 Ditto about skia.h.gch.

Powered by Google App Engine
This is Rietveld 408576698