Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable (sol2)
target_compile_definitions(sol2 INTERFACE SOL_NO_CHECK_NUMBER_PRECISION)
# Force usage of "nil" in Sol2.
# This is necessary for Apple platforms (e.g. macOS) where it considers "nil" to be a reserved keyword
target_compile_definitions(sol2 INTERFACE SOL_NO_NIL=0)

#
# sourcemap
Expand Down
9 changes: 6 additions & 3 deletions cmake/compiler/clang/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ if(BUILD_SHARED_LIBS)
INTERFACE
-fvisibility=hidden)

# --no-undefined to throw errors when there are undefined symbols
# (caused through missing TRINITY_*_API macros).
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --no-undefined")
# Throw errors when there are undefined symbols (caused through missing TRINITY_*_API macros)
# This is the default behavior on macOS since clang 15. Explicitly setting this flag raises a warning
# See https://stackoverflow.com/a/77526119/3672398
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --no-undefined")
endif ()

message(STATUS "Clang: Disallow undefined symbols")
endif()