2009-09-28 15:46:51 +00:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2007-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 00:48:47 +00:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 15:46:51 +00:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2007-06-28 13:14:27 +00:00
|
|
|
IF(UNIX)
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
|
|
|
|
ELSE(UNIX)
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
|
|
|
|
ENDIF(UNIX)
|
|
|
|
|
2007-07-11 17:39:51 +00:00
|
|
|
SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
|
2008-10-14 20:07:11 +00:00
|
|
|
SET(CMAKE_BASE_NAME)
|
2007-06-28 13:14:27 +00:00
|
|
|
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
|
|
|
|
|
|
|
|
IF("${CMAKE_BASE_NAME}" STREQUAL "as")
|
|
|
|
SET(CMAKE_BASE_NAME gas)
|
|
|
|
ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
|
|
|
|
|
2010-08-15 14:36:38 +00:00
|
|
|
# Load compiler-specific information.
|
|
|
|
SET(_INCLUDED_FILE "")
|
|
|
|
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
|
|
|
INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
|
|
|
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
|
|
|
IF(NOT _INCLUDED_FILE)
|
2011-01-30 20:03:37 +00:00
|
|
|
IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
|
|
|
MESSAGE(FATAL_ERROR "Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
|
|
|
|
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
2010-08-15 14:36:38 +00:00
|
|
|
INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
|
|
|
|
ENDIF(NOT _INCLUDED_FILE)
|
2007-06-28 13:14:27 +00:00
|
|
|
|
2007-07-11 17:39:51 +00:00
|
|
|
IF(CMAKE_SYSTEM_PROCESSOR)
|
2010-08-15 14:36:38 +00:00
|
|
|
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
|
|
|
IF(NOT _INCLUDED_FILE)
|
|
|
|
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
|
|
|
ENDIF(NOT _INCLUDED_FILE)
|
2007-07-11 17:39:51 +00:00
|
|
|
ENDIF(CMAKE_SYSTEM_PROCESSOR)
|
|
|
|
|
2010-08-15 14:36:38 +00:00
|
|
|
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
2007-07-11 17:39:51 +00:00
|
|
|
IF(NOT _INCLUDED_FILE)
|
2010-08-15 14:36:38 +00:00
|
|
|
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
2007-07-11 17:39:51 +00:00
|
|
|
ENDIF(NOT _INCLUDED_FILE)
|
2007-06-28 13:14:27 +00:00
|
|
|
|
2010-05-12 20:02:43 +00:00
|
|
|
# Set default assembler file extensions:
|
2009-02-27 18:08:05 +00:00
|
|
|
IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
|
|
|
|
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
2007-06-28 13:14:27 +00:00
|
|
|
|
2010-05-12 20:02:43 +00:00
|
|
|
|
|
|
|
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
|
|
|
|
# avoid just having a space as the initial value for the cache
|
|
|
|
IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
|
|
|
|
ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
|
|
|
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
|
|
|
|
"Flags used by the assembler during all build types.")
|
|
|
|
|
|
|
|
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
|
|
|
# default build type is none
|
|
|
|
IF(NOT CMAKE_NO_BUILD_TYPE)
|
|
|
|
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
|
|
|
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
|
|
|
|
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
|
|
|
|
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
|
|
|
|
"Flags used by the assembler during debug builds.")
|
|
|
|
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
|
|
|
"Flags used by the assembler during release minsize builds.")
|
|
|
|
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
|
|
|
|
"Flags used by the assembler during release builds.")
|
|
|
|
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
|
|
|
"Flags used by the assembler during Release with Debug Info builds.")
|
|
|
|
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2007-06-28 13:14:27 +00:00
|
|
|
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
2011-02-12 16:20:23 +00:00
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
2007-06-28 13:14:27 +00:00
|
|
|
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
|
|
|
|
|
|
|
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
2008-03-04 01:24:18 +00:00
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
|
2007-06-28 13:14:27 +00:00
|
|
|
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
|
|
|
"<CMAKE_RANLIB> <TARGET> ")
|
|
|
|
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
|
2011-02-12 15:15:59 +00:00
|
|
|
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
2007-06-28 13:14:27 +00:00
|
|
|
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
|
|
|
|
|
|
|
# to be done
|
|
|
|
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
|
|
|
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
|
|
|
|
|
|
|
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
|
|
|
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
|
|
|
|
|
|
|
|
|
|
|
SET(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
|
|
|
|
|