Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -911,12 +911,12 @@ # (this is a variable that CrossCompile sets on recursive invocations) endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") +if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)" AND NOT CMAKE_CROSSCOMPILING) # On FreeBSD, /usr/local/* is not used by default. In order to build LLVM # with libxml2, iconv.h, etc., we must add /usr/local paths. include_directories(SYSTEM "/usr/local/include") link_directories("/usr/local/lib") -endif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") +endif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)" AND NOT CMAKE_CROSSCOMPILING) if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) # special hack for Solaris to handle crazy system sys/regset.h