Update cpp_cmake.rst

update CMAKE_C_FLAGS when compile C file
This commit is contained in:
Long Dao 2022-04-02 18:33:47 +07:00 committed by Xiang Xiao
parent 6c22e2894c
commit e25df6706d
1 changed files with 2 additions and 1 deletions

View File

@ -104,11 +104,12 @@ Creating the project
set(EXE_NAME hellocpp)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AC_HW_FLAGS} ${AC_DEFINES}")
set(CMAKE_CXX_FLAGS "${AC_HW_FLAGS} ${AC_DEFINES} ${AC_COMMON_FLAGS} ${AC_CXX_EXTRA_FLAGS}")
if (PARAM_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif()
set(CMAKE_SKIP_RPATH ON)
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_LINKER} ${AC_LINKER_FLAGS} -o ${EXE_NAME}.elf <OBJECTS> <LINK_LIBRARIES>")