From c069a57301a468dbc45f3f3775b623e5532f9398 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 19 Jun 2018 16:05:09 -0400 Subject: added NIMA sample to showcase animations improved third_party template to include headers as system headers for non-Windows machines Bug: skia: Change-Id: Id2fa74fc31b49f9b07cc83e7f60477c7ab4f8d83 Reviewed-on: https://skia-review.googlesource.com/135450 Commit-Queue: Brian Osman Reviewed-by: Mike Klein Reviewed-by: Brian Osman --- third_party/Nima-Cpp/BUILD.gn | 101 ++++++++++++++++++++++++++++++++++++++++++ third_party/third_party.gni | 37 +++++++++++----- 2 files changed, 128 insertions(+), 10 deletions(-) create mode 100644 third_party/Nima-Cpp/BUILD.gn (limited to 'third_party') diff --git a/third_party/Nima-Cpp/BUILD.gn b/third_party/Nima-Cpp/BUILD.gn new file mode 100644 index 0000000000..f3dc8b2309 --- /dev/null +++ b/third_party/Nima-Cpp/BUILD.gn @@ -0,0 +1,101 @@ +# Copyright 2018 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../third_party.gni") + +copy("copy-nima-cpp") { + sources = [ + "../externals/Nima-Cpp/Source", + ] + outputs = [ + "$target_gen_dir/Nima-Cpp/nima", + ] +} + +copy("copy-nima-math-cpp") { + sources = [ + "../externals/Nima-Math-Cpp/Source", + ] + outputs = [ + "$target_gen_dir/Nima-Math-Cpp/nima", + ] +} + +third_party("Nima-Cpp") { + deps = [ + ":copy-nima-cpp", + ":copy-nima-math-cpp", + ] + + public_include_dirs = [ + "$target_gen_dir/Nima-Cpp", + "$target_gen_dir/Nima-Math-Cpp", + ] + + configs -= [ + "//gn:no_exceptions", + "//gn:no_rtti", + ] + + sources = [ + "../externals/Nima-Cpp/Source/Actor.cpp", + "../externals/Nima-Cpp/Source/ActorBone.cpp", + "../externals/Nima-Cpp/Source/ActorCollider.cpp", + "../externals/Nima-Cpp/Source/ActorComponent.cpp", + "../externals/Nima-Cpp/Source/ActorEvent.cpp", + "../externals/Nima-Cpp/Source/ActorIKTarget.cpp", + "../externals/Nima-Cpp/Source/ActorImage.cpp", + "../externals/Nima-Cpp/Source/ActorInstance.cpp", + "../externals/Nima-Cpp/Source/ActorNode.cpp", + "../externals/Nima-Cpp/Source/ActorNodeSolo.cpp", + "../externals/Nima-Cpp/Source/ActorRenderNode.cpp", + "../externals/Nima-Cpp/Source/ActorRootBone.cpp", + "../externals/Nima-Cpp/Source/ActorStaticMesh.cpp", + "../externals/Nima-Cpp/Source/Animation/ActorAnimation.cpp", + "../externals/Nima-Cpp/Source/Animation/ActorAnimationInstance.cpp", + "../externals/Nima-Cpp/Source/Animation/ComponentAnimation.cpp", + "../externals/Nima-Cpp/Source/Animation/Interpolators/CubicSolver.cpp", + "../externals/Nima-Cpp/Source/Animation/Interpolators/ValueTimeCurveInterpolator.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrame.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameActiveChild.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameCustomProperty.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameDrawOrder.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameIKStrength.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameIsCollisionEnabled.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameLength.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameNumeric.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameOpacity.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFramePosX.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFramePosY.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameRotation.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameScaleX.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameScaleY.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameSequence.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameTrigger.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameVertexDeform.cpp", + "../externals/Nima-Cpp/Source/Animation/KeyFrames/KeyFrameWithInterpolation.cpp", + "../externals/Nima-Cpp/Source/Animation/PropertyAnimation.cpp", + "../externals/Nima-Cpp/Source/BinaryReader.cpp", + "../externals/Nima-Cpp/Source/BlockReader.cpp", + "../externals/Nima-Cpp/Source/CustomProperty.cpp", + "../externals/Nima-Cpp/Source/NestedActorAsset.cpp", + "../externals/Nima-Cpp/Source/NestedActorNode.cpp", + "../externals/Nima-Math-Cpp/Source/Mat2D.cpp", + "../externals/Nima-Math-Cpp/Source/Vec2D.cpp", + ] + + testonly = true + + cflags_cc = [] + if (is_win) { + defines = [ "_USE_MATH_DEFINES" ] + cflags_cc += [ + "/FI", + "algorithm", + ] + } + + enabled = !is_win || !is_clang +} diff --git a/third_party/third_party.gni b/third_party/third_party.gni index 7aaf63586f..384eeed580 100644 --- a/third_party/third_party.gni +++ b/third_party/third_party.gni @@ -4,21 +4,38 @@ # found in the LICENSE file. template("third_party") { + enabled = !defined(invoker.enabled) || invoker.enabled config(target_name + "_public") { - if (defined(invoker.public_defines)) { - defines = invoker.public_defines + if (enabled) { + cflags = [] + if (defined(invoker.public_defines)) { + defines = invoker.public_defines + } + if (is_win) { + include_dirs = invoker.public_include_dirs + } else { + foreach(dir, invoker.public_include_dirs) { + cflags += [ + "-isystem", + rebase_path(dir), + ] + } + } + } else { + not_needed(invoker, "*") } - include_dirs = invoker.public_include_dirs } source_set(target_name) { - forward_variables_from(invoker, "*", [ "public_include_dirs" ]) - public_configs = [ ":" + target_name + "_public" ] + if (enabled) { + forward_variables_from(invoker, "*", [ "public_include_dirs" ]) + public_configs = [ ":" + target_name + "_public" ] - # Warnings are just noise if we're not maintaining the code. - if (is_win) { - cflags = [ "/w" ] - } else { - cflags = [ "-w" ] + # Warnings are just noise if we're not maintaining the code. + if (is_win) { + cflags = [ "/w" ] + } else { + cflags = [ "-w" ] + } } } } -- cgit v1.2.3