-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to ndk-build in Application.mk
Bug: android/ndk#837 Tests: ./run_tests.py –rebuild –filter weak_symbols_build_support Change-Id: I08b45b667a7480fc6e68d6edffeecdb14700cde0
- Loading branch information
1 parent
251b613
commit 22d2943
Showing
5 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(CLEAR_VARS) | ||
LOCAL_MODULE := weak_symbols | ||
LOCAL_SRC_FILES := weak_symbols.cpp | ||
LOCAL_STATIC_LIBRARIES := googletest_main | ||
LOCAL_LDLIBS := -landroid | ||
include $(BUILD_EXECUTABLE) | ||
|
||
$(call import-module,third_party/googletest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_STL := c++_static | ||
APP_WEAK_API_DEFS := true |
14 changes: 14 additions & 0 deletions
14
tests/device/weak_symbols_build_support/jni/weak_symbols.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <gtest/gtest.h> | ||
#include <android/trace.h> | ||
#include <android/api-level.h> | ||
|
||
TEST(weak_symbols, weak_symbol_enable) { | ||
bool called = false; | ||
if (__builtin_available(android 29, *)) { | ||
// 0 is an arbitrary cookie. The specific value doesn't matter because | ||
// this will never run concurrently. | ||
ATrace_beginAsyncSection("ndk::asyncBeginEndSection", 0); | ||
called = true; | ||
} | ||
ASSERT_EQ(android_get_device_api_level() >= 29, called); | ||
} |