summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorNaren Manimohan <narendhar15@gmail.com>2019-03-21 17:00:04 +0100
committerBrad King <brad.king@kitware.com>2019-03-21 12:57:40 -0400
commit0404efe786b1e2c5c28065a53e55ec77217e7b49 (patch)
tree57e5ad638820c1894bf070b51741c454cb6b7584 /Modules
parent2060a1445c6c6350eb886cfe70f956dccaef798e (diff)
downloadcmake-0404efe786b1e2c5c28065a53e55ec77217e7b49.tar.gz
GHS: Add support for GHS Multi Generator in Linux
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake14
-rw-r--r--Modules/Platform/GHS-MULTI-Initialize.cmake6
2 files changed, 16 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 59dab6de46..594f85bc95 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/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 25004c60b0..db65d14b9c 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")