Skip to content

Commit

Permalink
Fix ABI compability when linking against OCCI when using clang.
Browse files Browse the repository at this point in the history
This patch improves the previous check whether the current compiler
is using an incompatible libstdc++ version or not.
  • Loading branch information
Teemperor committed Mar 24, 2017
1 parent bd580f5 commit be50f1f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sql/oracle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ add_definitions(${ORACLE_DEFINITIONS})
ROOT_GENERATE_DICTIONARY(G__Oracle *.h MODULE Oracle LINKDEF LinkDef.h)

ROOT_LINKER_LIBRARY(Oracle *.cxx G__Oracle.cxx LIBRARIES Core ${ORACLE_LIBRARIES} DEPENDENCIES Net RIO)
if(GCC_MAJOR GREATER 4)

# Check if libstdc++ uses the new string ABI and fall back to the old one if yes.
# We have to check for this because on the nightly builds we have an old occi
# installation that uses the old ABI, which results in linking errors.
CHECK_CXX_SOURCE_COMPILES(
"
#include <string>
#if _GLIBCXX_USE_CXX11_ABI == 0
#error NOCXX11
#endif
int main() {}
" GLIBCXX_USE_CXX11_ABI)

if(${GLIBCXX_USE_CXX11_ABI})
file(GLOB srcs src/TOracle*.cxx)
set_source_files_properties(${srcs} PROPERTIES COMPILE_DEFINITIONS _GLIBCXX_USE_CXX11_ABI=0)
endif()
Expand Down

0 comments on commit be50f1f

Please sign in to comment.