diff options
author | Brad King <brad.king@kitware.com> | 2019-01-18 11:58:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-18 11:58:35 (GMT) |
commit | 65a3abf999b30117447c2e62581fbcaec56aadd9 (patch) | |
tree | de9fc205fbcd9bf0fba74c82752a45bff4024bf9 /Modules | |
parent | 2e7d4029f42430ac7339d15ae7b6f849b0f7e429 (diff) | |
parent | 21ab58d3f8782e80145f14eb6e72926c9d17afc6 (diff) | |
download | CMake-65a3abf999b30117447c2e62581fbcaec56aadd9.zip CMake-65a3abf999b30117447c2e62581fbcaec56aadd9.tar.gz CMake-65a3abf999b30117447c2e62581fbcaec56aadd9.tar.bz2 |
Merge topic 'GHS_updates'
21ab58d3f8 GHS: Update test suite
72e0c115b7 GHS: Add Compiler ID detection
436cc5e991 GHS: try_compile() now uses GHS platform variables
4a1ec0de3d GHS: Fix toolset selection
1a66acdef2 GHS: Append ".gpj" to target name when generating build command
0c9e47d7cd GHS: Integrity Application updates
8044318431 GHS: Add support for some of the source file properties
73092b2213 GHS: Add support for object libraries
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2231
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCompilerIdDetection.cmake | 1 | ||||
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 1 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 1 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 85 | ||||
-rw-r--r-- | Modules/CMakePlatformId.h.in | 28 | ||||
-rw-r--r-- | Modules/CMakeTestCCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeTestCXXCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeTestCompilerCommon.cmake | 20 | ||||
-rw-r--r-- | Modules/Compiler/GHS-C.cmake | 20 | ||||
-rw-r--r-- | Modules/Compiler/GHS-CXX.cmake | 24 | ||||
-rw-r--r-- | Modules/Compiler/GHS-DetermineCompiler.cmake | 11 | ||||
-rw-r--r-- | Modules/Compiler/GHS.cmake | 6 | ||||
-rw-r--r-- | Modules/CompilerId/GHS_default.gpj.in | 8 | ||||
-rw-r--r-- | Modules/CompilerId/GHS_lib.gpj.in | 3 | ||||
-rw-r--r-- | Modules/Platform/GHS-MULTI-Initialize.cmake | 8 |
16 files changed, 149 insertions, 73 deletions
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index 9b2a91f..4d0c681 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -63,6 +63,7 @@ function(compiler_id_detection outvar lang) Cray TI Fujitsu + GHS ) if (lang STREQUAL C) list(APPEND ordered_compilers diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 1a0d8a6..4f355f3 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -31,6 +31,7 @@ if(NOT CMAKE_C_COMPILER_NAMES) endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio") +elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c) _cmake_find_compiler_path(C) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 0a0c37b..96b4209 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -30,6 +30,7 @@ if(NOT CMAKE_CXX_COMPILER_NAMES) endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio") +elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp) _cmake_find_compiler_path(CXX) diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 604ac27..d88f2ed 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -7,6 +7,7 @@ # code. include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) +include(CMakeTestCompilerCommon) function(CMAKE_DETERMINE_COMPILER_ABI lang src) if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED) @@ -23,6 +24,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # from which we might detect implicit link libraries. list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=") endif() + __TestCompiler_setTryCompileTargetType() try_compile(CMAKE_${lang}_ABI_COMPILED ${CMAKE_BINARY_DIR} ${src} CMAKE_FLAGS ${CMAKE_FLAGS} diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index f987d9a..2a0dbd3 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -52,6 +52,13 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) endforeach() endif() + # If the compiler is still unknown, fallback to GHS + if(NOT CMAKE_${lang}_COMPILER_ID AND "${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") + set(CMAKE_${lang}_COMPILER_ID GHS) + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "The ${lang} compiler identification is falling back to GHS.\n\n") + endif() + # CUDA < 7.5 is missing version macros if(lang STREQUAL "CUDA" AND CMAKE_${lang}_COMPILER_ID STREQUAL "NVIDIA" @@ -391,6 +398,40 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} separate_arguments(CMAKE_${lang}_XCODE_ARCHS) set(CMAKE_${lang}_XCODE_ARCHS "${CMAKE_${lang}_XCODE_ARCHS}" PARENT_SCOPE) endif() + elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") + set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR}) + set(id_src "${src}") + if (GHS_PRIMARY_TARGET) + set(ghs_primary_target "${GHS_PRIMARY_TARGET}") + else() + set(ghs_primary_target "${CMAKE_GENERATOR_PLATFORM}_${GHS_TARGET_PLATFORM}.tgt") + endif() + if ("${GHS_TARGET_PLATFORM}" MATCHES "integrity") + set(bsp_name "macro GHS_BSP=${GHS_BSP_NAME}") + set(os_dir "macro GHS_OS=${GHS_OS_DIR}") + endif() + set(command "${CMAKE_MAKE_PROGRAM}" "-commands" "-top" "GHS_default.gpj") + configure_file(${CMAKE_ROOT}/Modules/CompilerId/GHS_default.gpj.in + ${id_dir}/GHS_default.gpj @ONLY) + configure_file(${CMAKE_ROOT}/Modules/CompilerId/GHS_lib.gpj.in + ${id_dir}/GHS_lib.gpj @ONLY) + execute_process(COMMAND ${command} + WORKING_DIRECTORY ${id_dir} + OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT + ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT + RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT + ) + # 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_${lang}_COMPILER_ID_OUTPUT}" MATCHES "(${ghs_toolpath}[^ ]*)") + set(_comp "${CMAKE_MATCH_1}.exe") + if(EXISTS "${_comp}") + file(TO_CMAKE_PATH "${_comp}" _comp) + set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) + endif() + endif() else() execute_process( COMMAND "${CMAKE_${lang}_COMPILER}" @@ -550,7 +591,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(ARCHITECTURE_ID "${CMAKE_MATCH_1}") endif() if("${info}" MATCHES "INFO:compiler_version\\[([^]\"]*)\\]") - string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}") + string(REGEX REPLACE "^0+([0-9]+)" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") endif() if("${info}" MATCHES "INFO:compiler_version_internal\\[([^]\"]*)\\]") @@ -602,26 +643,28 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) if(WIN32) # The offset to the PE signature is stored at 0x3c. file(READ ${file} peoffsethex LIMIT 1 OFFSET 60 HEX) - string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1) - string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2) - set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}") - string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}") - string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}") - string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}") - string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}") - string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}") - string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}") - math(EXPR peoffset "${peoffsetexpression}") - - file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX) - if(peheader STREQUAL "50450000a201") - set(ARCHITECTURE_ID "SH3") - elseif(peheader STREQUAL "50450000a301") - set(ARCHITECTURE_ID "SH3DSP") - elseif(peheader STREQUAL "50450000a601") - set(ARCHITECTURE_ID "SH4") - elseif(peheader STREQUAL "50450000a801") - set(ARCHITECTURE_ID "SH5") + if(NOT peoffsethex STREQUAL "") + string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1) + string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2) + set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}") + string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}") + math(EXPR peoffset "${peoffsetexpression}") + + file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX) + if(peheader STREQUAL "50450000a201") + set(ARCHITECTURE_ID "SH3") + elseif(peheader STREQUAL "50450000a301") + set(ARCHITECTURE_ID "SH3DSP") + elseif(peheader STREQUAL "50450000a601") + set(ARCHITECTURE_ID "SH4") + elseif(peheader STREQUAL "50450000a801") + set(ARCHITECTURE_ID "SH5") + endif() endif() endif() diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index c2b5aa9..3cb7f24 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -91,6 +91,14 @@ # define PLATFORM_ID # endif +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + #else /* unknown platform */ # define PLATFORM_ID @@ -154,6 +162,26 @@ # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif #else # define ARCHITECTURE_ID #endif diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake index e34ae75..f74a1c6 100644 --- a/Modules/CMakeTestCCompiler.cmake +++ b/Modules/CMakeTestCCompiler.cmake @@ -22,6 +22,7 @@ unset(CMAKE_C_COMPILER_WORKS CACHE) # any makefiles or projects. if(NOT CMAKE_C_COMPILER_WORKS) PrintTestCompilerStatus("C" "") + __TestCompiler_setTryCompileTargetType() file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c "#ifdef __cplusplus\n" "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n" @@ -41,6 +42,7 @@ if(NOT CMAKE_C_COMPILER_WORKS) set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS}) unset(CMAKE_C_COMPILER_WORKS CACHE) set(C_TEST_WAS_RUN 1) + __TestCompiler_restoreTryCompileTargetType() endif() if(NOT CMAKE_C_COMPILER_WORKS) diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index e4d49ae..fe6bd25 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -22,6 +22,7 @@ unset(CMAKE_CXX_COMPILER_WORKS CACHE) # any makefiles or projects. if(NOT CMAKE_CXX_COMPILER_WORKS) PrintTestCompilerStatus("CXX" "") + __TestCompiler_setTryCompileTargetType() file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx "#ifndef __cplusplus\n" "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n" @@ -34,6 +35,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS}) unset(CMAKE_CXX_COMPILER_WORKS CACHE) set(CXX_TEST_WAS_RUN 1) + __TestCompiler_restoreTryCompileTargetType() endif() if(NOT CMAKE_CXX_COMPILER_WORKS) diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake index f76076f..6ee5175 100644 --- a/Modules/CMakeTestCompilerCommon.cmake +++ b/Modules/CMakeTestCompilerCommon.cmake @@ -5,3 +5,23 @@ function(PrintTestCompilerStatus LANG MSG) message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}") endfunction() + +# if required set the target type if not already explicitly set +macro(__TestCompiler_setTryCompileTargetType) + if(NOT CMAKE_TRY_COMPILE_TARGET_TYPE) + if("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") + #prefer static libraries to avoid linking issues + set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + set(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE 1) + endif() + endif() +endmacro() + +# restore the original value +# -- not necessary if __TestCompiler_setTryCompileTargetType() was used in function scope +macro(__TestCompiler_restoreTryCompileTargetType) + if(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE) + unset(CMAKE_TRY_COMPILE_TARGET_TYPE) + unset(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE) + endif() +endmacro() diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake index c30bdec..a825b0b 100644 --- a/Modules/Compiler/GHS-C.cmake +++ b/Modules/Compiler/GHS-C.cmake @@ -8,23 +8,3 @@ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -Odebug -g") string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -Ospace") string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -O") string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -O -g") - -set(CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT "-ldebug ${CMAKE_C_FLAGS_DEBUG_INIT}") -set(CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT}") -set(CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}") -set(CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT - "-ldebug ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}") - -if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) - set (CMAKE_C_GHS_KERNEL_FLAGS_DEBUG "${CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT}" - CACHE STRING "Kernel flags used by the compiler during debug builds.") - set (CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL - "${CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING - "Kernel flags used by the compiler during release builds for minimum size.") - set (CMAKE_C_GHS_KERNEL_FLAGS_RELEASE - "${CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT}" - CACHE STRING "Kernel flags used by the compiler during release builds.") - set (CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO - "${CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING - "Kernel flags used by the compiler during release builds with debug info.") -endif() diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake index b3018a7..07b5044 100644 --- a/Modules/Compiler/GHS-CXX.cmake +++ b/Modules/Compiler/GHS-CXX.cmake @@ -8,27 +8,3 @@ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -Odebug -g") string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -Ospace") string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -O") string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -O -g") - -set(CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT - "-ldebug ${CMAKE_CXX_FLAGS_DEBUG_INIT}") -set(CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT - "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}") -set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT - "${CMAKE_CXX_FLAGS_RELEASE_INIT}") -set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT - "-ldebug ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}") - -if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) - set (CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG - "${CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT}" - CACHE STRING "Kernel flags used by the compiler during debug builds.") - set (CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL - "${CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING - "Kernel flags used by the compiler during release builds for minimum size.") - set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE - "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT}" - CACHE STRING "Kernel flags used by the compiler during release builds.") - set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING - "Kernel flags used by the compiler during release builds with debug info.") -endif() diff --git a/Modules/Compiler/GHS-DetermineCompiler.cmake b/Modules/Compiler/GHS-DetermineCompiler.cmake index 56d24e2..368b375 100644 --- a/Modules/Compiler/GHS-DetermineCompiler.cmake +++ b/Modules/Compiler/GHS-DetermineCompiler.cmake @@ -1,6 +1,9 @@ -set(_compiler_id_pp_test "defined(__INTEGRITY)") +set(_compiler_id_pp_test "defined(__ghs__)") set(_compiler_id_version_compute " -# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEGRITY_MAJOR_VERSION) -# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEGRITY_MINOR_VERSION) -# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEGRITY_PATCH_VERSION)") +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 100) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__GHS_VERSION_NUMBER % 10) +# endif") diff --git a/Modules/Compiler/GHS.cmake b/Modules/Compiler/GHS.cmake index e6a867d..b41c3eb 100644 --- a/Modules/Compiler/GHS.cmake +++ b/Modules/Compiler/GHS.cmake @@ -3,6 +3,6 @@ if(__COMPILER_GHS) endif() set(__COMPILER_GHS 1) -set(CMAKE_EXECUTABLE_SUFFIX ".as") -set(CMAKE_LIBRARY_PATH_TERMINATOR "\n") -set(CMAKE_LIBRARY_PATH_FLAG " -L") +set(CMAKE_EXECUTABLE_SUFFIX "") +set(CMAKE_LIBRARY_PATH_TERMINATOR "") +set(CMAKE_LIBRARY_PATH_FLAG "") diff --git a/Modules/CompilerId/GHS_default.gpj.in b/Modules/CompilerId/GHS_default.gpj.in new file mode 100644 index 0000000..b5cea5c --- /dev/null +++ b/Modules/CompilerId/GHS_default.gpj.in @@ -0,0 +1,8 @@ +#!gbuild +@bsp_name@ +@os_dir@ +primaryTarget=@ghs_primary_target@ +[Project] + {isdefined(GHS_BSP)} -bsp $GHS_BSP + {isdefined(GHS_OS)} -os_dir $GHS_OS +GHS_lib.gpj [Library] diff --git a/Modules/CompilerId/GHS_lib.gpj.in b/Modules/CompilerId/GHS_lib.gpj.in new file mode 100644 index 0000000..149b981 --- /dev/null +++ b/Modules/CompilerId/GHS_lib.gpj.in @@ -0,0 +1,3 @@ +#!gbuild +[Library] +@id_src@ diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake index 9b384df..25004c6 100644 --- a/Modules/Platform/GHS-MULTI-Initialize.cmake +++ b/Modules/Platform/GHS-MULTI-Initialize.cmake @@ -9,6 +9,9 @@ mark_as_advanced(GHS_OS_ROOT) set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory") mark_as_advanced(GHS_OS_DIR) +set(GHS_OS_DIR_OPTION "-os_dir " CACHE STRING "GHS compiler os option") +mark_as_advanced(GHS_OS_DIR) + #set GHS_OS_DIR if not set by user if ( NOT GHS_OS_DIR ) if (EXISTS ${GHS_OS_ROOT}) @@ -23,8 +26,11 @@ if ( NOT GHS_OS_DIR ) endif () #filter based on platform name - if (GHS_TARGET_PLATFORM STREQUAL "integrity") + if (GHS_TARGET_PLATFORM MATCHES "integrity") list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*") + else() #fall-back for standalone + unset(GHS_CANDIDATE_OS_DIRS) + set(GHS_OS_DIR "IGNORE") endif () if (GHS_CANDIDATE_OS_DIRS) |