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
CMake: Use CMAKE_CXX_STANDARD instead of passing -std=c++14 #4703
Conversation
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) will likely be preferable to have set as well. |
Sure, I'll add those in and see what happens. |
625b5ca
to
7f9367d
Compare
The Android build seems to be running into android/ndk#222, where something in the NDK's toolchain file prevents |
Yes, and I knew of the issue, which is why I didn't use the flag. |
On a side note, the Android support in 3.7 (independent from Google's Gradle integration) works fine with it. Not sure we want to use it though... |
@Orphis: there are two proposed fixes up for AOSP (https://android-review.googlesource.com/#/c/326383/ (mine) and https://android-review.googlesource.com/#/c/324419/). Hopefully something will get merged for r14, and then In the meantime... what do you think about something like # The Android NDK toolchain file is broken.
# See https://github.com/android-ndk/ndk/issues/222
if(CMAKE_TOOLCHAIN_FILE MATCHES "android.toolchain.cmake$")
set(_new_toolchain_file "${CMAKE_CURRENT_BINARY_DIR}/android.toolchain.cmake")
if(NOT EXISTS "${_new_toolchain_file}")
file(TO_CMAKE_PATH "${CMAKE_TOOLCHAIN_FILE}" CMAKE_TOOLCHAIN_FILE)
file(WRITE "${_new_toolchain_file}" "
include(\"${CMAKE_TOOLCHAIN_FILE}\")
set(CMAKE_C_COMPILER_ID_RUN FALSE)
set(CMAKE_CXX_COMPILER_ID_RUN FALSE)
")
set(CMAKE_TOOLCHAIN_FILE "${_new_toolchain_file}")
endif()
endif() ? Too much? |
Something will be merged for r14, the issue is tagged with r14 in Github after all. |
The android buildbot was updated a few weeks ago, may you rebase and ask anyone to merge it? LGTM. |
Available since CMake 3.1
7f9367d
to
c464029
Compare
Available since CMake 3.1