aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-08-04 12:51:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-04 12:51:20 -0700
commitad82ed67dfa5514a17dcca0412c81756b3b03095 (patch)
treeec78b678fabd4bb116d617d8605510c629c719a2 /src
parent5672da0fa54f31c9727568e9dd5fe82c6e1585bc (diff)
Force linking as C++ library.
BUG=skia: R=bungeman@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/420183004
Diffstat (limited to 'src')
-rw-r--r--src/core/SkForceCPlusPlusLinking.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/SkForceCPlusPlusLinking.cpp b/src/core/SkForceCPlusPlusLinking.cpp
new file mode 100644
index 0000000000..829d0d3fe6
--- /dev/null
+++ b/src/core/SkForceCPlusPlusLinking.cpp
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+// This file is intentionally empty. We add it to the dependencies of skia_lib
+// so that GYP detects that libskia is a C++ library (implicitly depending on
+// the standard library, -lm, etc.) from its file extension.
+//
+// If we didn't do this, GYP would link libskia.so as a C library and we'd get
+// link-time failures for simple binaries that don't themselves depend on the
+// C++ standard library.
+//
+// Even if we try hard not to depend on the standard library, say, never
+// calling new or delete, the compiler can still insert calls on our behalf
+// that make us depend on it anyway: a handler when we call a for a pure
+// virtual, thread-safety guards around statics, probably other similar
+// language constructs.