Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
add RTTI again to avoid uncaught exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bqminh committed Apr 1, 2017
1 parent 05f727d commit 45d0504
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
message("Compiler : GNU Compiler (gcc)")
set(GCC "TRUE")
# set(COMBINED_FLAGS "-Wall -Wno-unused-function -Wno-sign-compare -pedantic -D_GNU_SOURCE -fms-extensions -Wno-deprecated")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -ffunction-sections -fdata-sections -fno-rtti")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -ffunction-sections -fdata-sections")
set(CMAKE_C_FLAGS_RELEASE "-O3 -g -ffunction-sections -fdata-sections")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
# require at least gcc 4.8
Expand All @@ -140,7 +140,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message("Compiler : Clang")
set(CLANG "TRUE")
# set(COMBINED_FLAGS "-Wall -Wno-unused-function -Wno-sign-compare -pedantic -D_GNU_SOURCE -Wno-nested-anon-types")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-rtti -ffunction-sections -fdata-sections")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffunction-sections -fdata-sections")
set(CMAKE_C_FLAGS_RELEASE "-O3 -ffunction-sections -fdata-sections")
if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,-dead_strip")
Expand Down Expand Up @@ -187,7 +187,11 @@ endif()

# enable link time optimization
if (IQTREE_FLAGS MATCHES "lto")
set(COMBINED_FLAGS "${COMBINED_FLAGS} -flto")
#if (CLANG)
# set(COMBINED_FLAGS "${COMBINED_FLAGS} -flto=thin")
#else()
set(COMBINED_FLAGS "${COMBINED_FLAGS} -flto")
#endif()
endif()

##################################################################
Expand Down

0 comments on commit 45d0504

Please sign in to comment.