diff options
author | Brad King <brad.king@kitware.com> | 2019-03-22 13:22:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-22 13:22:44 (GMT) |
commit | 89abbdd8c8db5bf587373f2a00f6a816eddd8496 (patch) | |
tree | 815aaa6b4a54b6782bfb30550a20cfa6e4ee8ccb /Modules | |
parent | 4e47e9967aa9d4cd76375468e3b175cd313f3877 (diff) | |
parent | 2c43fb5be345b75d12bba227979efd74b810b49a (diff) | |
download | CMake-89abbdd8c8db5bf587373f2a00f6a816eddd8496.zip CMake-89abbdd8c8db5bf587373f2a00f6a816eddd8496.tar.gz CMake-89abbdd8c8db5bf587373f2a00f6a816eddd8496.tar.bz2 |
Merge topic 'ghs-linux'
2c43fb5be3 FindThreads: Fix pthread library check in GHS Multi Generator
0404efe786 GHS: Add support for GHS Multi Generator in Linux
2060a1445c Tests: Fix file name case in GHS object library test
ddad70c8a4 Tests: Run GHS tests in a separate ctest process
f7dca1fc97 GHS: Fix include-what-you-use and clang-tidy diagnostics
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3006
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 14 | ||||
-rw-r--r-- | Modules/FindThreads.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/GHS-MULTI-Initialize.cmake | 6 |
3 files changed, 19 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 59dab6d..594f85b 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -431,10 +431,18 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} ) # Match the compiler location line printed out. set(ghs_toolpath "${CMAKE_MAKE_PROGRAM}") - string(REPLACE "/gbuild.exe" "/" ghs_toolpath ${ghs_toolpath}) - string(REPLACE / "\\\\" ghs_toolpath ${ghs_toolpath}) + if(CMAKE_HOST_UNIX) + string(REPLACE "/gbuild" "/" ghs_toolpath ${ghs_toolpath}) + else() + string(REPLACE "/gbuild.exe" "/" ghs_toolpath ${ghs_toolpath}) + string(REPLACE / "\\\\" ghs_toolpath ${ghs_toolpath}) + endif() if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "(${ghs_toolpath}[^ ]*)") - set(_comp "${CMAKE_MATCH_1}.exe") + if(CMAKE_HOST_UNIX) + set(_comp "${CMAKE_MATCH_1}") + else() + set(_comp "${CMAKE_MATCH_1}.exe") + endif() if(EXISTS "${_comp}") file(TO_CMAKE_PATH "${_comp}" _comp) set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 3684f01..d317b71 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -161,6 +161,9 @@ if(CMAKE_HAVE_PTHREAD_H) _check_pthreads_flag() endif () + if(CMAKE_SYSTEM MATCHES "GHS-MULTI") + _check_threads_lib(posix pthread_create CMAKE_HAVE_PTHREADS_CREATE) + endif() _check_threads_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE) _check_threads_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE) if(CMAKE_SYSTEM_NAME MATCHES "SunOS") diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake index 25004c6..db65d14 100644 --- a/Modules/Platform/GHS-MULTI-Initialize.cmake +++ b/Modules/Platform/GHS-MULTI-Initialize.cmake @@ -3,7 +3,11 @@ #Setup Green Hills MULTI specific compilation information -set(GHS_OS_ROOT "C:/ghs" CACHE PATH "GHS platform OS search root directory") +if(CMAKE_HOST_UNIX) + set(GHS_OS_ROOT "/usr/ghs" CACHE PATH "GHS platform OS search root directory") +else() + set(GHS_OS_ROOT "C:/ghs" CACHE PATH "GHS platform OS search root directory") +endif() mark_as_advanced(GHS_OS_ROOT) set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory") |