Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Use -O0 for debug build (#695)
Browse files Browse the repository at this point in the history
Signed-off-by: Yudong Cai <[email protected]>
  • Loading branch information
cydrain authored Feb 17, 2023
1 parent 4305304 commit 7f69477
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmake/utils/compile_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ endif()

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(STATUS "Build in Debug mode")
set(CMAKE_CXX_FLAGS "-O1 -g -Wall -fPIC ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-O0 -g -Wall -fPIC ${CMAKE_CXX_FLAGS}")
if(USE_CUDA)
set(CMAKE_CUDA_FLAGS
"-O1 -g -Xcompiler=-w -Xcompiler=-fPIC ${CMAKE_CUDA_FLAGS}")
"-O0 -g -Xcompiler=-w -Xcompiler=-fPIC ${CMAKE_CUDA_FLAGS}")
endif()
else()
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC ${CMAKE_CXX_FLAGS}")

if(USE_CUDA)
set(CMAKE_CUDA_FLAGS
"-O2 -Xcompiler=-w -Xcompiler=-fPIC ${CMAKE_CUDA_FLAGS}")
"-O2 -Xcompiler=-w -Xcompiler=-fPIC ${CMAKE_CUDA_FLAGS}")
endif()
endif()

0 comments on commit 7f69477

Please sign in to comment.