Skip to content
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] #1423

Closed
qvoid opened this issue Jan 7, 2021 · 1 comment
Closed

[BUG] #1423

qvoid opened this issue Jan 7, 2021 · 1 comment
Labels

Comments

@qvoid
Copy link

qvoid commented Jan 7, 2021

Description

Can not build a release version with cmake and "CMAKE_TOOLCHAIN_FILE" already set to "Release"

When doing a cross compile using ndk-22 with cmake. And specify CMAK_BUILD_TYPE by doing this:

cmake -DCMAKE_TOOLCHAIN_FILE="<path-to-android.toolchain.cmake>" -DCMAKE_BUILD_TYPE=Release 
...

I found the size of libraries and generated didn't get smaller comparing to "DCMAKE_BUILD_TYPE=Debug"

After some research, I found the root cause is that -g flags is appended to "ANDROID_COMPILER_FLAGS" by default.
Removing this will successfully build a release version library.

So, I am wondering why the -g flags is set? How can I remove it without modifying "android.toolchain.cmake" under "/build/cmake" ?

Besides, this happens to ndk 16 too.

Environment Details

Not all of these will be relevant to every bug, but please provide as much
information as you can.

  • NDK Version: 22.0.7026061
  • Build system: CMake
  • Host OS: Ubuntu 18.04
  • ABI: armeabi-v7a
  • NDK API level: 27
  • Device API level:
@qvoid qvoid added the bug label Jan 7, 2021
@DanAlbert
Copy link
Member

#243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants