有没有办法迫使Android的NDK改变Eclipse构建配置时重建一个特定的图书馆吗?
我建立使用Android NDK构建C ++库建设的Android项目。 我使用Eclipse与塞阔亚插件。 一切设置和行之有效的。
但是,我遇到了与构建配置的问题。 您可以通过右键单击项目 - >属性管理构建配置,然后进入C / C ++编译部分。 这允许您创建传统的调试和发布版本,大多数C ++库在某种程度上依赖。
这是我的“调试”配置的例子:
V=1 NDK_DEBUG=1 NDK_APPLICATION_MK=config/debug/Application.mk
这些工作的很好,只是当我再次打开和配置之间来回,它不会触发重建我建立了图书馆。 这将预期的东西像Visual Studio,其中每个生成配置转储到不同的目录,但在Eclipse中一切都被转储到同一目录中。 我不得不实际改变相关的源文件来触发重建。 那么最终发生的是我最终的调试配置下运行(例如),但链接到建在释放库。
所以我的问题是: 有没有办法迫使NDK重建库更改配置时? 我知道-B命令我可以添加的,但重建的一切 , 每次 。 重建每一次,如果我可以只是一个特定的图书馆这样做(在这种情况下libBootInfo)我会好起来的。
这里是我的根Android.mk文件的样子:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game$(MY_BUILD_CONFIG_EXTENSION)
# Include files are relative to the NDK root directly (fix by prepending with $(LOCAL_PATH))
# Source files are relative $(LOCAL_PATH)
#LOCAL_LDLIBS := -landroid
# Add all source file names to be included in lib separated by a whitespace
LOCAL_SRC_FILES := ../../../../../../engine/code/main/mainandroid.cpp
# Module dependencies are expressed with LOCAL_STATIC_LIBRARIES and LOCAL_SHARED_LIBRARIES.
# we're building the "main" entry point, so it doesn't depend on much
LOCAL_STATIC_LIBRARIES := libDebug$(MY_BUILD_CONFIG_EXTENSION) libCore$(MY_BUILD_CONFIG_EXTENSION)
include $(BUILD_SHARED_LIBRARY)
$(call import-module,libBdCore)
$(call import-module,libDebug)
##################################################################
## In addition to the core game library, we also build another
## *.so file here: "libBootInfo". This very small library is used
## by Java to find out which version of game to load based on
## the current build configuration.
##
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libBootInfo
# Add all source file names to be included in lib separated by a whitespace
# TODO: This path is relative to "android-ndk\build\core" which seems
# different from the LOCAL_SRC_FILES in game above. It seems like
# the build process leaves us in a different directory than we started.
# We make need to look into a way to make sure that this path always
# works regardless of what came before it.
#
LOCAL_SRC_FILES := ../../../../engine/code/main/bootinfo.cpp
include $(BUILD_SHARED_LIBRARY)