diff --git a/CMakeLists.txt b/CMakeLists.txt index 39d9106d8bfc..d8984a112141 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ if (LEGACY_BUILD) option(NO_ENCRYPTION "If enabled, no platform-default encryption will be included in the library. For the library to be used you will need to provide your own platform-specific implementations" OFF) option(USE_IXML_HTTP_REQUEST_2 "If enabled on windows, the com object IXmlHttpRequest2 will be used for the http stack" OFF) option(ENABLE_RTTI "Flag to enable/disable rtti within the library" ON) + option(NO_CPPSTD_IN_PKG_CONFIG "Removes cpp language standard from being included in pkg config installs" OFF) option(ENABLE_TESTING "Flag to enable/disable building unit and integration tests" ON) option(AUTORUN_UNIT_TESTS "Flag to enable/disable automatically run unit tests after building" ON) option(ANDROID_BUILD_CURL "When building for Android, should curl be built as well" ON) diff --git a/cmake/compiler_settings.cmake b/cmake/compiler_settings.cmake index 41fcf9378596..9b178294ec95 100644 --- a/cmake/compiler_settings.cmake +++ b/cmake/compiler_settings.cmake @@ -36,7 +36,12 @@ endfunction() macro(set_gcc_flags) - list(APPEND AWS_COMPILER_FLAGS "-fno-exceptions" "-std=c++${CPP_STANDARD}") + list(APPEND AWS_COMPILER_FLAGS "-fno-exceptions") + + if(NOT NO_CPPSTD_IN_PKG_CONFIG) + list(APPEND AWS_COMPILER_FLAGS "-std=c++${CPP_STANDARD}") + endif() + if(COMPILER_IS_MINGW) list(APPEND AWS_COMPILER_FLAGS -D__USE_MINGW_ANSI_STDIO=1) endif()