Skip to content

Commit

Permalink
Specify LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
XanthosXanthopoulos committed Jan 24, 2025
1 parent 5da8b9c commit deae609
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ def run(self):
if sys.platform == "darwin":
CXX_FLAGS.append("-mmacosx-version-min=13.3")

# This is necessary for clang to enable templated function calls
# between pybind modules and libtiledbsoma where dynamic_cast or
# std::any_cast is involved
CXX_FLAGS.append("-D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2")

if os.name == "posix" and sys.platform != "darwin":
LIB_DIRS.append(str(tiledbsoma_dir / "lib" / "x86_64-linux-gnu"))
LIB_DIRS.append(str(tiledbsoma_dir / "lib64"))
Expand Down
4 changes: 3 additions & 1 deletion libtiledbsoma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Don't use GNU extensions
# Build with fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_VERBOSE_MAKEFILE ON)

# Set default builds/configuration to be Release.
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if (is_multi_config)
Expand Down Expand Up @@ -221,7 +223,7 @@ if(MSVC)
)
else()

set(TILEDBSOMA_COMPILE_OPTIONS -Wall -Wextra -DSPDLOG_USE_STD_FORMAT)
set(TILEDBSOMA_COMPILE_OPTIONS -Wall -Wextra -DSPDLOG_USE_STD_FORMAT -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2)

if(${TILEDBSOMA_ENABLE_WERROR})
set(TILEDBSOMA_WERROR_OPTION -Werror)
Expand Down
7 changes: 3 additions & 4 deletions libtiledbsoma/src/soma/soma_column.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,10 @@ class SOMAColumn {
_non_empty_domain_slot_opt(ctx, array));
} catch (const std::exception& e) {
throw TileDBSOMAError(std::format(
"[SOMAColumn][non_empty_domain_slot] Failed on \"{}\" with "
"error \"{}\", type '{}'",
"[SOMAColumn][non_empty_domain_slot_opt] Failed on \"{}\" with "
"error \"{}\"",
name(),
e.what(),
typeid(T).name()));
e.what()));
}
}

Expand Down

0 comments on commit deae609

Please sign in to comment.