-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] CMake toolchain file sets CMAKE_ANDROID_EXCEPTION instead of CMAKE_ANDROID_EXCEPTIONS #1618
Comments
While the fix is trivial, we're having trouble putting together a regression test. What's the behavior difference you're seeing? Exceptions are on by default, and if I pass
That does fail to build as expected:
But if I remove the |
The typo is in the non-legacy toolchain file, so you need to test with a new cmake (3.21.x and up). |
Ah, crap. Good catch. My system's CMake is 3.21.4 but the script I used to generate a CMake test case uses the prebuilt :) |
Yeah, there we go. The same test case using the correct version of CMake compiles successfully when |
Should be fixed in r23 build 8486889. |
CMAKE_ANDROID_EXCEPTIONS Bug: android/ndk#1618 Test: None Change-Id: I40c6db01bd34123640e826ebda5eb4f9c94fe075 (cherry picked from commit 379a69bce48ee049f21f91490f0429c8c1c6a92a) Merged-In: I40c6db01bd34123640e826ebda5eb4f9c94fe075
Tests: No Bugs: android/ndk#1618 Change-Id: I211593312ae6858a30a401a10681230cafb3214d (cherry picked from commit 6bd8bfd9c3b5dbdbdfa1be5eb25f614c0d724b05) Merged-In: I211593312ae6858a30a401a10681230cafb3214d
Bug: android/ndk#1618 Test: None Change-Id: Ifd678a5a8d30470165b33edd4264a23d9e689a97 (cherry picked from commit 7e6c50f3538a9b289d1f57166d3ebcdd74c13c84) Merged-In: Ifd678a5a8d30470165b33edd4264a23d9e689a97
Description
The NDK's CMake toolchain file sets a variable named
CMAKE_ANDROID_EXCEPTION
, but it should beCMAKE_ANDROID_EXCEPTIONS
(note the plural rather than singular). This variable will therefore have no effect when CMake is deciding whether to add-fexceptions
or-fno-exceptions
to theCMAKE_<LANG>_FLAGS_INIT
flags, resulting in the flag being determined purely based on the selected STL type. This only affects build arrangements whereANDROID_CPP_FEATURES
is set (I'm not sure what situations do that).Environment Details
Found while working on macOS on an M1 machine. NDK 23.1.7779620 was installed via Android Studio, but the toolchain file from a standalone NDK package (r24-beta1) still has the same problem.
The text was updated successfully, but these errors were encountered: