diff --git a/lib/lua/CMakeLists.txt b/lib/lua/CMakeLists.txt index 109348534..29abd17a3 100644 --- a/lib/lua/CMakeLists.txt +++ b/lib/lua/CMakeLists.txt @@ -87,6 +87,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") endif() message(STATUS "using gnu compiler") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} ") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS} -g") + set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${CMAKE_C_FLAGS} -O1 -g") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} ${CMAKE_C_FLAGS} -g") elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y") @@ -97,6 +101,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") endif() message(STATUS "using clang compiler") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} ") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS} -g") + set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${CMAKE_C_FLAGS} -O1 -g") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} ${CMAKE_C_FLAGS} -g") else() if (CMAKE_VERSION VERSION_GREATER 3.0) set(CMAKE_C_STANDARD 11)