Skip to content

Commit ce3d3f6

Browse files
committed
complier setting for c+11 and up
1 parent 900683e commit ce3d3f6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cmake/compiler_settings.cmake

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function(set_compiler_flags target)
2222
if(NOT MSVC)
2323
set_gcc_flags()
2424
target_compile_options(${target} PRIVATE "${AWS_COMPILER_FLAGS}")
25-
string(REPLACE ";" " " _TMP "${AWS_COMPILER_FLAGS}")
25+
string(REPLACE ";" " " _TMP "${AWS_PUBLIC_COMPILER_FLAGS}")
2626
set(PKG_CONFIG_CFLAGS "${_TMP}" CACHE INTERNAL "C++ compiler flags which affect the ABI")
2727
endif()
2828
endfunction()
@@ -36,17 +36,26 @@ endfunction()
3636

3737

3838
macro(set_gcc_flags)
39-
list(APPEND AWS_COMPILER_FLAGS "-fno-exceptions" "-std=c++${CPP_STANDARD}")
39+
# Internal flags - only for SDK compilation
40+
list(APPEND AWS_COMPILER_FLAGS "-std=c++${CPP_STANDARD}")
41+
42+
# Public flags - needed by downstream projects for ABI compatibility
43+
list(APPEND AWS_COMPILER_FLAGS "-fno-exceptions")
44+
list(APPEND AWS_PUBLIC_COMPILER_FLAGS "-fno-exceptions")
45+
4046
if(COMPILER_IS_MINGW)
4147
list(APPEND AWS_COMPILER_FLAGS -D__USE_MINGW_ANSI_STDIO=1)
48+
list(APPEND AWS_PUBLIC_COMPILER_FLAGS -D__USE_MINGW_ANSI_STDIO=1)
4249
endif()
4350

4451
if(NOT BUILD_SHARED_LIBS)
4552
list(APPEND AWS_COMPILER_FLAGS "-fPIC")
53+
list(APPEND AWS_PUBLIC_COMPILER_FLAGS "-fPIC")
4654
endif()
4755

4856
if(NOT ENABLE_RTTI)
4957
list(APPEND AWS_COMPILER_FLAGS "-fno-rtti")
58+
list(APPEND AWS_PUBLIC_COMPILER_FLAGS "-fno-rtti")
5059
endif()
5160

5261
if(MINIMIZE_SIZE AND COMPILER_GCC)

0 commit comments

Comments
 (0)