Skip to content

Commit ce76b36

Browse files
authored
fix: warnings in the Android NDK build (#1087)
1 parent f1699e1 commit ce76b36

File tree

4 files changed

+40
-34
lines changed

4 files changed

+40
-34
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if(WIN32)
66
else()
77
# The Android tools ship with this ancient version, which we need to support.
88
cmake_minimum_required (VERSION 3.10)
9+
cmake_policy(SET CMP0077 NEW)
910
endif()
1011

1112
#read sentry-native version

ndk/README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Android NDK support for sentry-native
22

33
| Package | Maven Central | Minimum Android API Level | Supported ABIs |
4-
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------- |
4+
|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|---------------------------------------------|
55
| `io.sentry:sentry-native-ndk` | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-native-ndk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-native-ndk) | 19 | "x86", "armeabi-v7a", "x86_64", "arm64-v8a" |
66

77
## Resources
@@ -29,46 +29,46 @@ The `ndk` project uses the Gradle build system in combination with CMake. You ca
2929
1. Set a custom `versionName` in the `ndk/gradle.properties` file
3030
2. Publish the package locally
3131

32-
```shell
33-
cd ndk
34-
./gradlew :sentry-native-ndk:publishToMavenLocal
35-
```
32+
```shell
33+
cd ndk
34+
./gradlew :sentry-native-ndk:publishToMavenLocal
35+
```
3636

3737
3. Consume the build in your app
3838

39-
```
40-
// usually settings.gradle
41-
allprojects {
42-
repositories {
43-
mavenLocal()
44-
}
45-
}
46-
47-
// usually app/build.gradle
48-
android {
49-
buildFeatures {
50-
prefab = true
51-
}
52-
}
53-
54-
dependencies {
55-
implementation("io.sentry:sentry-native-ndk:<version>")
56-
}
57-
```
39+
```
40+
// usually settings.gradle
41+
allprojects {
42+
repositories {
43+
mavenLocal()
44+
}
45+
}
46+
47+
// usually app/build.gradle
48+
android {
49+
buildFeatures {
50+
prefab = true
51+
}
52+
}
53+
54+
dependencies {
55+
implementation("io.sentry:sentry-native-ndk:<version>")
56+
}
57+
```
5858

5959
4. Link the pre-built packages with your native code
6060

61-
```cmake
62-
# usually app/CMakeLists.txt
61+
```cmake
62+
# usually app/CMakeLists.txt
6363
64-
find_package(sentry-native-ndk REQUIRED CONFIG)
64+
find_package(sentry-native-ndk REQUIRED CONFIG)
6565
66-
target_link_libraries(<app> PRIVATE
67-
${LOG_LIB}
68-
sentry-native-ndk::sentry-android
69-
sentry-native-ndk::sentry
70-
)
71-
```
66+
target_link_libraries(<app> PRIVATE
67+
${LOG_LIB}
68+
sentry-native-ndk::sentry-android
69+
sentry-native-ndk::sentry
70+
)
71+
```
7272

7373
## Development
7474

src/sentry_value.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
#if defined(_MSC_VER)
1010
# pragma warning(push)
1111
# pragma warning(disable : 4127) // conditional expression is constant
12+
#elif defined(__clang__)
13+
# pragma clang diagnostic push
14+
# pragma clang diagnostic ignored "-Wstatic-in-inline"
1215
#endif
1316

1417
#include "../vendor/mpack.h"
1518

1619
#if defined(_MSC_VER)
1720
# pragma warning(pop)
21+
#elif defined(__clang__)
22+
# pragma clang diagnostic pop
1823
#endif
1924

2025
#include "sentry_alloc.h"

0 commit comments

Comments
 (0)