From: Colin Cross Date: Mon, 12 Sep 2016 21:35:39 +0000 (-0700) Subject: Convert libart-gtest to Android.bp X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6b22aa5106e60545119b9eeaceaa9f87ee597305;p=android-x86%2Fart.git Convert libart-gtest to Android.bp Change-Id: Ibea17e3e002e6ad3f82158cd3c69d087fa9b15c9 --- diff --git a/Android.bp b/Android.bp index f7e909d07..e8b608efc 100644 --- a/Android.bp +++ b/Android.bp @@ -33,6 +33,7 @@ subdirs = [ "profman", "runtime", "sigchainlib", + "test", "tools/cpp-define-generator", "tools/dmtracedump", ] diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk index 12b50b859..b5bbfef1f 100644 --- a/build/Android.gtest.mk +++ b/build/Android.gtest.mk @@ -417,39 +417,6 @@ COMPILER_GTEST_HOST_SRC_FILES += $(COMPILER_GTEST_HOST_SRC_FILES_all) ART_TEST_CFLAGS := -include $(CLEAR_VARS) -LOCAL_MODULE := libart-gtest -LOCAL_MODULE_TAGS := optional -LOCAL_CPP_EXTENSION := cc -LOCAL_SRC_FILES := runtime/common_runtime_test.cc compiler/common_compiler_test.cc -LOCAL_C_INCLUDES := $(ART_C_INCLUDES) art/runtime art/cmdline art/compiler -LOCAL_SHARED_LIBRARIES := libartd libartd-compiler libdl -LOCAL_WHOLE_STATIC_LIBRARIES += libgtest -LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk -LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk -$(eval LOCAL_CLANG := $(ART_TARGET_CLANG)) -$(eval $(call set-target-local-cflags-vars,debug)) -LOCAL_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated -Wno-missing-noreturn # gtest issue -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := libart-gtest -LOCAL_MODULE_TAGS := optional -LOCAL_CPP_EXTENSION := cc -LOCAL_CFLAGS := $(ART_HOST_CFLAGS) -LOCAL_ASFLAGS := $(ART_HOST_ASFLAGS) -LOCAL_SRC_FILES := runtime/common_runtime_test.cc compiler/common_compiler_test.cc -LOCAL_C_INCLUDES := $(ART_C_INCLUDES) art/runtime art/cmdline art/compiler -LOCAL_SHARED_LIBRARIES := libartd libartd-compiler -LOCAL_WHOLE_STATIC_LIBRARIES := libgtest -LOCAL_LDLIBS += -ldl -lpthread -LOCAL_MULTILIB := both -LOCAL_CLANG := $(ART_HOST_CLANG) -LOCAL_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated -Wno-missing-noreturn # gtest issue -LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk -LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk -include $(BUILD_HOST_SHARED_LIBRARY) - # Variables holding collections of gtest pre-requisits used to run a number of gtests. ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := diff --git a/compiler/Android.bp b/compiler/Android.bp index 595a82499..058141837 100644 --- a/compiler/Android.bp +++ b/compiler/Android.bp @@ -279,3 +279,12 @@ art_cc_library { }, shared_libs: ["libartd"], } + +art_cc_library { + name: "libart-compiler-gtest", + defaults: ["libart-gtest-defaults"], + srcs: ["common_compiler_test.cc"], + shared_libs: [ + "libartd-compiler", + ], +} diff --git a/runtime/Android.bp b/runtime/Android.bp index eb7b0c82f..e4d50ee3d 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -462,6 +462,15 @@ art_cc_library { ], } +art_cc_library { + name: "libart-runtime-gtest", + defaults: ["libart-gtest-defaults"], + srcs: ["common_runtime_test.cc"], + shared_libs: [ + "libartd", + ], +} + subdirs = [ "openjdkjvm", "openjdkjvmti", diff --git a/test/Android.bp b/test/Android.bp new file mode 100644 index 000000000..e2edc1895 --- /dev/null +++ b/test/Android.bp @@ -0,0 +1,82 @@ +// +// Copyright (C) 2016 The Android Open Source Project +// +// 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. +// + +art_cc_defaults { + name: "libart-gtest-defaults", + host_supported: true, + defaults: [ + "art_defaults", + "art_debug_defaults", + ], + shared_libs: [ + "libartd", + "libartd-compiler", + ], + static_libs: [ + "libgtest", + ], + target: { + android32: { + cflags: ["-DART_TARGET_NATIVETEST_DIR=/data/nativetest32/art"], + }, + android64: { + cflags: ["-DART_TARGET_NATIVETEST_DIR=/data/nativetest64/art"], + }, + android: { + cflags: [ + // gtest issue + "-Wno-used-but-marked-unused", + "-Wno-deprecated", + "-Wno-missing-noreturn", + ], + }, + linux: { + cflags: [ + // gtest issue + "-Wno-used-but-marked-unused", + "-Wno-deprecated", + "-Wno-missing-noreturn", + ], + }, + }, +} + +art_cc_library { + name: "libart-gtest", + host_supported: true, + whole_static_libs: [ + "libart-compiler-gtest", + "libart-runtime-gtest", + "libgtest", + ], + shared_libs: [ + "libartd", + "libartd-compiler", + ], + target: { + android: { + shared_libs: [ + "libdl", + ], + }, + host: { + host_ldlibs: [ + "-ldl", + "-lpthread", + ], + }, + }, +}