Skip to content

Commit 98a3801

Browse files
committed
Fix C++ header problem on MacOS
* tool did not find C++ headers on MacOS * solved this by putting a soft link into the expected place
1 parent fa86a4d commit 98a3801

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tool/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,12 @@ install(PROGRAMS run_O2CodeChecker.py DESTINATION bin)
3939
# we need to install the builtin headers in a path which is searched by the tool
4040
# FIXME: a soft link would be better
4141
install(DIRECTORY ${LLVM_LIBRARY_DIR}/clang/${LLVM_PACKAGE_VERSION}/include DESTINATION lib/clang/${LLVM_PACKAGE_VERSION})
42+
43+
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
44+
# On MacOS we need to do the same with C++ headers since they are in a non-standard location
45+
# (alternative would be to set the CPATH environment variable)
46+
INSTALL(CODE "execute_process(COMMAND mkdir ${CMAKE_INSTALL_PREFIX}/include)")
47+
INSTALL(CODE "execute_process(COMMAND ln -sf \
48+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++ \
49+
${CMAKE_INSTALL_PREFIX}/include/c++)")
50+
ENDIF()

0 commit comments

Comments
 (0)