Skip to content

Commit 6c06571

Browse files
authored
Override CMake flags to enable assertion in release builds (#486)
* Override CMake flags to enable assertion in release builds * Fix typo in CMakeLists.txt
1 parent 31777f7 commit 6c06571

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gpu-simulator/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ else()
1919
set(CMAKE_BUILD_TYPE Release)
2020
endif()
2121

22+
# Override default CMake Release flags to keep assertions enabled
23+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g3 -fPIC -Wall")
24+
2225
# check envrionment variable string compare
2326
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
2427
add_compile_definitions(DEBUG=1)
2528
add_compile_options(-Wall -O0 -g3 -fPIC)
2629
else()
2730
add_compile_definitions(DEBUG=0)
28-
add_compile_options(-Wall -O3 -g3 -fPIC)
2931
endif()
3032

3133
# run command
@@ -92,4 +94,4 @@ add_custom_target(gen_pyi ALL
9294
)
9395

9496

95-
install(TARGETS accel-sim.out DESTINATION ${CMAKE_SOURCE_DIR}/bin/$ENV{ACCELSIM_CONFIG})
97+
install(TARGETS accel-sim.out DESTINATION ${CMAKE_SOURCE_DIR}/bin/$ENV{ACCELSIM_CONFIG})

0 commit comments

Comments
 (0)