diff --git a/infer/lib/python/inferlib/capture/ndk-build.py b/infer/lib/python/inferlib/capture/ndk-build.py index 872c61e65..38658f3a3 100644 --- a/infer/lib/python/inferlib/capture/ndk-build.py +++ b/infer/lib/python/inferlib/capture/ndk-build.py @@ -29,8 +29,13 @@ create_argparser = util.base_argparser(MODULE_DESCRIPTION, MODULE_NAME) class NdkBuildCapture(): def __init__(self, args, cmd): - cmd = [cmd[0], 'NDK_TOOLCHAIN_VERSION=clang', 'TARGET_CC=clang', - 'TARGET_CXX=clang++', 'TARGET_LD=ld'] + cmd[1:] + cmd = [ + cmd[0], + 'NDK_TOOLCHAIN_VERSION=clang', + 'TARGET_CC=clang', + 'TARGET_CXX=clang', + 'TARGET_LD=ld', + ] + cmd[1:] self.args = args self.cmd = cmd command_name = os.path.basename(cmd[0]) diff --git a/infer/tests/build_systems/codetoanalyze/ndk-build/hello_app/jni/Application.mk b/infer/tests/build_systems/codetoanalyze/ndk-build/hello_app/jni/Application.mk new file mode 100644 index 000000000..9663939c6 --- /dev/null +++ b/infer/tests/build_systems/codetoanalyze/ndk-build/hello_app/jni/Application.mk @@ -0,0 +1,5 @@ +# Copyright (c) 2019-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +APP_PLATFORM := android-21 diff --git a/infer/tests/build_systems/ndk_build/Makefile b/infer/tests/build_systems/ndk_build/Makefile index d756beb0d..31f07aeaa 100644 --- a/infer/tests/build_systems/ndk_build/Makefile +++ b/infer/tests/build_systems/ndk_build/Makefile @@ -9,7 +9,7 @@ PROJECT_ROOT = ../codetoanalyze/ndk-build/hello_app SOURCES = $(PROJECT_ROOT)/hello.c OBJECTS = $(PROJECT_ROOT)/hello.o INFERPRINT_OPTIONS = --issues-tests -CLEAN_EXTRA = libs obj +CLEAN_EXTRA = $(PROJECT_ROOT)/libs $(PROJECT_ROOT)/obj include $(TESTS_DIR)/infer.make @@ -21,4 +21,4 @@ infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(QUIET)cd $(PROJECT_ROOT) && \ $(call silent_on_success,Testing ndk-build clang integration,\ $(INFER_BIN) --results-dir $(CURDIR)/infer-out -- \ - $(NDKBUILD) -B NDK_LIBS_OUT=./libs NDK_OUT=./obj) + $(NDKBUILD) -B NDK_LIBS_OUT=./libs NDK_OUT=./obj V=1)