Skip to content Skip to sidebar Skip to footer

How To Dynamically Get The Current Compiler Target File Name In Android.mk's Local_cflags?

I am currently trying to build a native module using Android's NDK. My project consists of several source files (e.g.: FILENAME.c) and for each of them I need to declare a define i

Solution 1:

In the beginning of your Android.mk, add the line that redefines get-src-file-target-cflags, like here:

get-src-file-target-cflags = $(LOCAL_SRC_FILES_TARGET_CFLAGS.$1) -DOPERATION_$(basename $1)

LOCAL_PATH := $(call my-dir)include$(CLEAR_VARS)
LOCAL_SRC_FILES := t.cpp qq.c
LOCAL_MODULE := tm
LOCAL_LDLIBS := -latomic

include$(BUILD_SHARED_LIBRARY)

You can put this line in Application.mk, if you choose.

Post a Comment for "How To Dynamically Get The Current Compiler Target File Name In Android.mk's Local_cflags?"