From b5bb61a75699cb09e3c7b319aa530fd05af6baa7 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 14 May 2024 14:02:41 -0700 Subject: [PATCH] Stop downgrading C++ std. C17 and C++17 are clang's default. --- camera/basic/src/main/cpp/CMakeLists.txt | 2 +- camera/texture-view/src/main/cpp/CMakeLists.txt | 2 +- endless-tunnel/app/src/main/cpp/CMakeLists.txt | 2 +- gles3jni/app/src/main/cpp/CMakeLists.txt | 2 +- hello-gl2/app/src/main/cpp/CMakeLists.txt | 2 +- hello-libs/app/src/main/cpp/CMakeLists.txt | 2 +- hello-vulkan/app/src/main/cpp/CMakeLists.txt | 2 +- native-activity/app/src/main/cpp/CMakeLists.txt | 2 +- native-audio/app/src/main/cpp/CMakeLists.txt | 2 +- native-codec/app/src/main/cpp/CMakeLists.txt | 2 +- native-midi/app/src/main/cpp/CMakeLists.txt | 2 +- prefab/curl-ssl/app/src/main/cpp/Application.mk | 1 - prefab/prefab-dependency/app/src/main/cpp/Application.mk | 1 - sensor-graph/accelerometer/src/main/cpp/CMakeLists.txt | 2 +- 14 files changed, 12 insertions(+), 14 deletions(-) diff --git a/camera/basic/src/main/cpp/CMakeLists.txt b/camera/basic/src/main/cpp/CMakeLists.txt index e66ebc6c3..a43a348c8 100644 --- a/camera/basic/src/main/cpp/CMakeLists.txt +++ b/camera/basic/src/main/cpp/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(app_glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) # now build app's shared lib -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") # Export ANativeActivity_onCreate(), # Refer to: https://github.com/android-ndk/ndk/issues/381. set(CMAKE_SHARED_LINKER_FLAGS diff --git a/camera/texture-view/src/main/cpp/CMakeLists.txt b/camera/texture-view/src/main/cpp/CMakeLists.txt index 17ee0ca5d..cee46ab61 100644 --- a/camera/texture-view/src/main/cpp/CMakeLists.txt +++ b/camera/texture-view/src/main/cpp/CMakeLists.txt @@ -20,7 +20,7 @@ set(CMAKE_VERBOSE_MAKEFILE on) set(COMMON_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../common) # now build app's shared lib -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") # Export ANativeActivity_onCreate(), # Refer to: https://github.com/android-ndk/ndk/issues/381. diff --git a/endless-tunnel/app/src/main/cpp/CMakeLists.txt b/endless-tunnel/app/src/main/cpp/CMakeLists.txt index 035ead87a..5d2b2dda9 100644 --- a/endless-tunnel/app/src/main/cpp/CMakeLists.txt +++ b/endless-tunnel/app/src/main/cpp/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") # Set common compiler options -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") add_definitions("-DGLM_FORCE_SIZE_T_LENGTH -DGLM_FORCE_RADIANS") # Import the CMakeLists.txt for the glm library diff --git a/gles3jni/app/src/main/cpp/CMakeLists.txt b/gles3jni/app/src/main/cpp/CMakeLists.txt index 088153a42..5bc15c842 100644 --- a/gles3jni/app/src/main/cpp/CMakeLists.txt +++ b/gles3jni/app/src/main/cpp/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 3.22.1) # [24, infinite) ES2 & ES3 & Vulkan set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions -Wall") if (${ANDROID_PLATFORM_LEVEL} LESS 12) message(FATAL_ERROR "OpenGL 2 is not supported before API level 11 \ (currently using ${ANDROID_PLATFORM_LEVEL}).") diff --git a/hello-gl2/app/src/main/cpp/CMakeLists.txt b/hello-gl2/app/src/main/cpp/CMakeLists.txt index 1fe6ae4f7..c023ce61f 100644 --- a/hello-gl2/app/src/main/cpp/CMakeLists.txt +++ b/hello-gl2/app/src/main/cpp/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.22.1) # now build app's shared lib -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") add_library(gl2jni SHARED gl_code.cpp) diff --git a/hello-libs/app/src/main/cpp/CMakeLists.txt b/hello-libs/app/src/main/cpp/CMakeLists.txt index 34c784cd7..3551c445e 100644 --- a/hello-libs/app/src/main/cpp/CMakeLists.txt +++ b/hello-libs/app/src/main/cpp/CMakeLists.txt @@ -31,7 +31,7 @@ set_target_properties(lib_gperf PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/gperf/lib/${ANDROID_ABI}/libgperf.so) # build application's shared lib -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") add_library(hello-libs SHARED hello-libs.cpp) diff --git a/hello-vulkan/app/src/main/cpp/CMakeLists.txt b/hello-vulkan/app/src/main/cpp/CMakeLists.txt index 4a6472063..e80231695 100644 --- a/hello-vulkan/app/src/main/cpp/CMakeLists.txt +++ b/hello-vulkan/app/src/main/cpp/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_SHARED_LINKER_FLAGS set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Now build app's shared lib -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR=1) diff --git a/native-activity/app/src/main/cpp/CMakeLists.txt b/native-activity/app/src/main/cpp/CMakeLists.txt index dfd10d224..933146c82 100644 --- a/native-activity/app/src/main/cpp/CMakeLists.txt +++ b/native-activity/app/src/main/cpp/CMakeLists.txt @@ -22,7 +22,7 @@ add_library(native_app_glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) # now build app's shared lib -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror") # Export ANativeActivity_onCreate(), # Refer to: https://github.com/android-ndk/ndk/issues/381. diff --git a/native-audio/app/src/main/cpp/CMakeLists.txt b/native-audio/app/src/main/cpp/CMakeLists.txt index 95558e347..7602810d3 100644 --- a/native-audio/app/src/main/cpp/CMakeLists.txt +++ b/native-audio/app/src/main/cpp/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.22.1) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") add_library(native-audio-jni SHARED native-audio-jni.c) diff --git a/native-codec/app/src/main/cpp/CMakeLists.txt b/native-codec/app/src/main/cpp/CMakeLists.txt index 84788ef37..86ffc238d 100644 --- a/native-codec/app/src/main/cpp/CMakeLists.txt +++ b/native-codec/app/src/main/cpp/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.22.1) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -UNDEBUG") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -UNDEBUG") add_library(native-codec-jni SHARED looper.cpp diff --git a/native-midi/app/src/main/cpp/CMakeLists.txt b/native-midi/app/src/main/cpp/CMakeLists.txt index 9c48a89aa..ae42529af 100644 --- a/native-midi/app/src/main/cpp/CMakeLists.txt +++ b/native-midi/app/src/main/cpp/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.22.1) project(native_midi LANGUAGES C CXX) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Werror -O0") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -O0") add_library(${PROJECT_NAME} SHARED diff --git a/prefab/curl-ssl/app/src/main/cpp/Application.mk b/prefab/curl-ssl/app/src/main/cpp/Application.mk index 121331fea..f7ab6a339 100644 --- a/prefab/curl-ssl/app/src/main/cpp/Application.mk +++ b/prefab/curl-ssl/app/src/main/cpp/Application.mk @@ -1,3 +1,2 @@ APP_STL := c++_shared -APP_CPPFLAGS := -std=c++17 APP_CFLAGS := -Wall -Werror diff --git a/prefab/prefab-dependency/app/src/main/cpp/Application.mk b/prefab/prefab-dependency/app/src/main/cpp/Application.mk index 121331fea..f7ab6a339 100644 --- a/prefab/prefab-dependency/app/src/main/cpp/Application.mk +++ b/prefab/prefab-dependency/app/src/main/cpp/Application.mk @@ -1,3 +1,2 @@ APP_STL := c++_shared -APP_CPPFLAGS := -std=c++17 APP_CFLAGS := -Wall -Werror diff --git a/sensor-graph/accelerometer/src/main/cpp/CMakeLists.txt b/sensor-graph/accelerometer/src/main/cpp/CMakeLists.txt index e7ab02df1..e3de0fe6c 100644 --- a/sensor-graph/accelerometer/src/main/cpp/CMakeLists.txt +++ b/sensor-graph/accelerometer/src/main/cpp/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.22.1) # That warning is ignore for now because those are release config only issues # caused by assert(). The fix is to migrate to CHECK/DCHECK, but that requires # importing absl or libbase first. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -Wno-unused-variable") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-unused-variable") add_library(accelerometergraph SHARED sensorgraph.cpp)