Commit 10e543b9 by Michael Schmid

added cxx_flags

parent 03adc123
......@@ -26,19 +26,24 @@
#
function(SetGNUCompilerFlags compiler_libs)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
if(DEFINED CMAKE_SYSTEM_PROCESSOR)
if(DEFINED __TriCore__)
set(compiler_libs PARENT_SCOPE)
set(common_flags "-fno-common -Os -std=c99")
set(warning_flags "-W -Wall -Wextra -Wdiv-by-zero -Warray-bounds -Wcast-align -Wignored-qualifiers -Wformat -Wformat-security")
set(common_c_flags "-fno-common -Os -std=c99")
set(common_cxx_flags "-fno-common -std=c++0x")
set(warning_flags "-W -Wall -Wextra")
set(target_flags "-DAPPKIT_TC277TFT -DEMBB_DEBUG -fshort-double -mcpu=tc27xx -mversion-info")
if (WARNINGS_ARE_ERRORS STREQUAL ON)
set(warning_flags "${warning_flags} -Werror")
endif()
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${common_flags} ${warning_flags} ${target_flags}"
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${common_c_flags} ${warning_flags} ${target_flags}"
PARENT_SCOPE)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${common_cxx_flags} ${warning_flags} ${target_flags}"
PARENT_SCOPE)
endif()
else()
set(compiler_libs pthread rt PARENT_SCOPE)
# -Wall -> All warnings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment