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

Fix for toolchain flags. #87

Merged
merged 2 commits into from
Jan 11, 2019
Merged

Fix for toolchain flags. #87

merged 2 commits into from
Jan 11, 2019

Conversation

jubeira
Copy link

@jubeira jubeira commented Jan 10, 2019

@jubeira jubeira requested a review from meyerj January 10, 2019 17:12
Copy link

@meyerj meyerj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work. At least the -g flag disappeared again from compiler command lines.

For the RelWithDebInfo build I am not sure about the exact order or whether the remainder of the file is required at all. I think it can be completely removed. If not, CMAKE_*_FLAGS_RELWITHDEBINFO is cached below, after copying the values of CMAKE_*_FLAGS_RELEASE. So in theory it should contain ANDROID_COMPILER_FLAGS_RELEASE then and the last three lines will add ANDROID_COMPILER_FLAGS_RELWITHDEBINFO again.

Line 20 is not necessary because ANDROID_COMPILER_FLAGS_RELWITHDEBINFO copied from ANDROID_COMPILER_FLAGS_RELEASE has already been converted to a space-separated string in the included toolchain file.

@jubeira
Copy link
Author

jubeira commented Jan 11, 2019

I just submitted the changes; PTAL @meyerj

@meyerj meyerj merged commit b295e0b into kinetic Jan 11, 2019
@meyerj meyerj deleted the fix/toolchain_flags_fix branch January 11, 2019 21:26
@meyerj
Copy link

meyerj commented Jan 11, 2019

The last three lines could have been removed, too, but it also does not matter:

if(ANDROID_TOOLCHAIN STREQUAL clang)
  list(APPEND ANDROID_COMPILER_FLAGS_RELWITHDEBINFO -fno-limit-debug-info)
endif()

ANDROID_COMPILER_FLAGS_RELWITHDEBINFO is not used directly afaik. At the moment CMAKE_*_FLAGS_RELWITHDEBINFO are the same as CMAKE_*_FLAGS_RELEASE with -g preprended, and only those will be forwarded to the compiler. So -fno-limit-debug-info would not be set for RelWithDebInfo. Not sure whether it would be required.

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

Successfully merging this pull request may close these issues.

2 participants