Skip to content

Commit

Permalink
use -fno-assume-unique-vtables to make dyanmic_cast to the final clas…
Browse files Browse the repository at this point in the history
…s work
  • Loading branch information
yhmtsai committed Nov 13, 2024
1 parent abc9214 commit 848adaf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
if(MINGW OR CYGWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Otherwise, dynamic_cast to the class marked by final will be failed.
# https://reviews.llvm.org/D154658 should be relevant
set(CMAKE_CXX_FLGAS "${CMAKE_CXX_FLAGS} -fno-assume-unique-vtables")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
endif()
endif()

# For now, PGI/NVHPC nvc++ compiler doesn't seem to support
Expand Down

0 comments on commit 848adaf

Please sign in to comment.