From 728471f32ae5f8ed10bca65ae8c38818adccb896 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 29 Nov 2022 21:32:37 -0400 Subject: [PATCH] Use proper cmake settings for C++17 mode instead of gradle cppflags --- libsession-util/build.gradle | 1 - libsession-util/src/main/cpp/CMakeLists.txt | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libsession-util/build.gradle b/libsession-util/build.gradle index 12cbb892ea..10d1845f7b 100644 --- a/libsession-util/build.gradle +++ b/libsession-util/build.gradle @@ -14,7 +14,6 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { - cppFlags "--std=c++17" } } // ndk { diff --git a/libsession-util/src/main/cpp/CMakeLists.txt b/libsession-util/src/main/cpp/CMakeLists.txt index 753c99e8e9..487fa7e454 100644 --- a/libsession-util/src/main/cpp/CMakeLists.txt +++ b/libsession-util/src/main/cpp/CMakeLists.txt @@ -9,6 +9,11 @@ cmake_minimum_required(VERSION 3.18.1) project("session_util") +# Compiles in C++17 mode +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + # Creates and names a library, sets it as either STATIC # or SHARED, and provides the relative paths to its source code. # You can define multiple libraries, and CMake builds them for you.