summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorAdrien Destugues <pulkomandy@pulkomandy.tk>2014-03-03 14:57:05 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-21 12:19:10 (GMT)
commit0cc42b871ab9c9153d839ab8fc55a6a887d55092 (patch)
tree63965e3a977fe1405619195ca7a6944482901db5 /Modules/Platform
parent84603d804c285c75f4bf81f9d79f0ebd0ca68fea (diff)
downloadCMake-0cc42b871ab9c9153d839ab8fc55a6a887d55092.zip
CMake-0cc42b871ab9c9153d839ab8fc55a6a887d55092.tar.gz
CMake-0cc42b871ab9c9153d839ab8fc55a6a887d55092.tar.bz2
Haiku: Fix compiler detection when using distcc
Also remove outdated include directories.
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Haiku.cmake27
1 files changed, 16 insertions, 11 deletions
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 825f851..dfc2664 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -21,18 +21,26 @@ set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
# "/boot/system/develop/lib/<subdir>/", which we assume to be the secondary
# architecture specific subdirectory and extract the name of the architecture
# accordingly.
-set(__HAIKU_COMPILER ${CMAKE_C_COMPILER})
-if(NOT __HAIKU_COMPILER)
+# First of all, find a C or C++ compiler we can run. The "arg1" is necessary
+# here for compilers such as "distcc gcc-x86" or "ccache gcc-x86"
+# TODO See CMakeDetermineCompilerId.cmake for some more things we may want to do.
+if(CMAKE_C_COMPILER)
+ set(__HAIKU_COMPILER ${CMAKE_C_COMPILER})
+ string (STRIP "${CMAKE_C_COMPILER_ARG1}" __HAIKU_COMPILER_FLAGS)
+else()
set(__HAIKU_COMPILER ${CMAKE_CXX_COMPILER})
+ string (STRIP "${CMAKE_CXX_COMPILER_ARG1}" __HAIKU_COMPILER_FLAGS)
endif()
+
execute_process(
- COMMAND ${__HAIKU_COMPILER} -print-search-dirs
+ COMMAND ${__HAIKU_COMPILER} ${__HAIKU_COMPILER_FLAGS} -print-search-dirs
OUTPUT_VARIABLE _HAIKU_SEARCH_DIRS
+ RESULT_VARIABLE _HAIKU_SEARCH_DIRS_FOUND
OUTPUT_STRIP_TRAILING_WHITESPACE)
-string(REGEX MATCH ".*\nlibraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/(:[^\n]*)?\n.*" _dummy "\n${_HAIKU_SEARCH_DIRS}\n")
+string(REGEX MATCH "libraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/?(:?\n+)" _dummy "${_HAIKU_SEARCH_DIRS}\n")
set(CMAKE_HAIKU_SECONDARY_ARCH "${CMAKE_MATCH_2}")
if(NOT CMAKE_HAIKU_SECONDARY_ARCH)
@@ -53,14 +61,12 @@ else()
endif()
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- /boot/common/non-packaged
- /boot/common
+ /boot/system/non-packaged
/boot/system
)
LIST(APPEND CMAKE_HAIKU_COMMON_INCLUDE_DIRECTORIES
- /boot/common/non-packaged/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
- /boot/common/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ /boot/system/non-packaged/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
/boot/system/develop/headers/os
/boot/system/develop/headers/os/app
/boot/system/develop/headers/os/device
@@ -108,8 +114,7 @@ LIST(APPEND CMAKE_HAIKU_CXX_INCLUDE_DIRECTORIES
LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_HAIKU_C_INCLUDE_DIRECTORIES})
LIST(APPEND CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES
- /boot/common/non-packaged/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
- /boot/common/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ /boot/system/non-packaged/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
/boot/system/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
)
@@ -120,6 +125,6 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES})
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
+ set(CMAKE_INSTALL_PREFIX "/boot/system" CACHE PATH
"Install path prefix, prepended onto install directories." FORCE)
endif()