diff --git a/android_test/Android.mk b/android_test/Android.mk index 41ef93a5..dbaf93ba 100644 --- a/android_test/Android.mk +++ b/android_test/Android.mk @@ -1,2 +1,12 @@ LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_CPP_EXTENSION := .cc .cpp .cxx +LOCAL_SRC_FILES:=test.cpp +LOCAL_MODULE:=spirvtools_test +LOCAL_LDLIBS:=-landroid +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror +LOCAL_STATIC_LIBRARIES=SPIRV-Tools SPIRV-Tools-opt +include $(BUILD_SHARED_LIBRARY) + include $(LOCAL_PATH)/../Android.mk diff --git a/android_test/jni/Application.mk b/android_test/jni/Application.mk index 1f3808bc..d7ccd349 100644 --- a/android_test/jni/Application.mk +++ b/android_test/jni/Application.mk @@ -2,3 +2,4 @@ APP_ABI := all APP_BUILD_SCRIPT := Android.mk APP_STL := gnustl_static APP_PLATFORM := android-9 +NDK_TOOLCHAIN_VERSION := 4.9 diff --git a/android_test/test.cpp b/android_test/test.cpp new file mode 100644 index 00000000..e6a57c12 --- /dev/null +++ b/android_test/test.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +void android_main(struct android_app* /*state*/) { + spvtools::SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); + spvtools::Optimizer optimizer(SPV_ENV_UNIVERSAL_1_2); +}