From d3e9e8a078a01df4a50f824e0a41b7ca8caf99bf Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 8 Feb 2011 22:23:54 +0100 Subject: [PATCH] Add support for ASM for the SunPro compiler Alex --- Modules/CMakeDetermineASMCompiler.cmake | 4 ++++ Modules/Compiler/SunPro-ASM.cmake | 26 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Modules/Compiler/SunPro-ASM.cmake diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index c09077e37..5db604dac 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -95,6 +95,10 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version") SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)") + LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro ) + SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V") + SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C") + LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP ) SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h") SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments") diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake new file mode 100644 index 000000000..5f5fafeb6 --- /dev/null +++ b/Modules/Compiler/SunPro-ASM.cmake @@ -0,0 +1,26 @@ +set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s ) + +set(CMAKE_ASM_COMPILE_OBJECT " -o -c ") + +SET(CMAKE_ASM_VERBOSE_FLAG "-#") + +SET(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC") +SET(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":") +SET(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h") + +SET(CMAKE_ASM_FLAGS_INIT "") +SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g") +SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG") +SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG") +SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") + +# Initialize ASM link type selection flags. These flags are used when +# building a shared library, shared module, or executable that links +# to other libraries to select whether to use the static or shared +# versions of the libraries. +FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE) + SET(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic") + SET(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic") +ENDFOREACH(type)