2009-09-28 19:46:51 +04: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 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:46:51 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(UNIX)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
|
|
|
|
set(CMAKE_BASE_NAME)
|
|
|
|
get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if("${CMAKE_BASE_NAME}" STREQUAL "as")
|
|
|
|
set(CMAKE_BASE_NAME gas)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2010-08-15 18:36:38 +04:00
|
|
|
# Load compiler-specific information.
|
2012-08-13 21:47:32 +04:00
|
|
|
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)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT _INCLUDED_FILE)
|
|
|
|
if("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
|
|
|
message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR)
|
|
|
|
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)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
|
|
|
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
|
|
|
if(NOT _INCLUDED_FILE)
|
|
|
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2010-05-13 00:02:43 +04:00
|
|
|
# Set default assembler file extensions:
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2010-05-13 00:02:43 +04:00
|
|
|
|
|
|
|
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
|
2010-05-13 00:02:43 +04:00
|
|
|
# avoid just having a space as the initial value for the cache
|
2012-08-13 21:47:32 +04:00
|
|
|
if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
|
2010-05-13 00:02:43 +04:00
|
|
|
"Flags used by the assembler during all build types.")
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
2010-05-13 00:02:43 +04:00
|
|
|
# default build type is none
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_NO_BUILD_TYPE)
|
|
|
|
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
2010-05-13 00:02:43 +04:00
|
|
|
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
|
2010-05-13 00:02:43 +04:00
|
|
|
"Flags used by the assembler during debug builds.")
|
2012-08-13 21:47:32 +04:00
|
|
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
2010-05-13 00:02:43 +04:00
|
|
|
"Flags used by the assembler during release minsize builds.")
|
2012-08-13 21:47:32 +04:00
|
|
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
|
2010-05-13 00:02:43 +04:00
|
|
|
"Flags used by the assembler during release builds.")
|
2012-08-13 21:47:32 +04:00
|
|
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
2010-05-13 00:02:43 +04:00
|
|
|
"Flags used by the assembler during Release with Debug Info builds.")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2010-05-13 00:02:43 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
|
2010-05-13 00:02:43 +04:00
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
|
|
|
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
|
2007-06-28 17:14:27 +04:00
|
|
|
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
|
|
|
"<CMAKE_RANLIB> <TARGET> ")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
|
2011-02-12 18:15:59 +03:00
|
|
|
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
|
|
|
|
set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
|
|
|
|
endif()
|
2011-03-02 21:44:13 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
|
|
|
|
set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
|
|
|
|
endif()
|
2011-03-02 21:44:13 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
|
|
|
|
set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
|
|
|
|
endif()
|
2011-03-02 21:44:13 +03:00
|
|
|
|
2007-06-28 17:14:27 +04:00
|
|
|
# to be done
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-06-28 17:14:27 +04:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
|
2007-06-28 17:14:27 +04:00
|
|
|
|