2009-12-04 17:20:24 +03:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2002-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-12-04 17:20:24 +03:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
|
|
|
# This module is shared by multiple languages; use include blocker.
|
|
|
|
if(__LINUX_COMPILER_INTEL)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
set(__LINUX_COMPILER_INTEL 1)
|
|
|
|
|
2009-08-21 17:54:42 +04:00
|
|
|
if(NOT XIAR)
|
2009-10-02 21:24:32 +04:00
|
|
|
set(_intel_xiar_hints)
|
2009-08-21 17:54:42 +04:00
|
|
|
foreach(lang C CXX Fortran)
|
|
|
|
if(IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}")
|
|
|
|
get_filename_component(_hint "${CMAKE_${lang}_COMPILER}" PATH)
|
2009-10-02 21:24:32 +04:00
|
|
|
list(APPEND _intel_xiar_hints ${_hint})
|
2009-08-21 17:54:42 +04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2009-10-02 21:24:32 +04:00
|
|
|
find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints})
|
2009-08-21 17:54:42 +04:00
|
|
|
mark_as_advanced(XIAR)
|
|
|
|
endif(NOT XIAR)
|
2009-12-04 17:20:24 +03:00
|
|
|
|
|
|
|
macro(__linux_compiler_intel lang)
|
2012-05-05 23:11:35 +04:00
|
|
|
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
|
|
|
|
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
|
2009-12-04 17:20:24 +03:00
|
|
|
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
|
|
|
|
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
|
|
|
|
|
2010-01-13 16:13:46 +03:00
|
|
|
# We pass this for historical reasons. Projects may have
|
|
|
|
# executables that use dlopen but do not set ENABLE_EXPORTS.
|
|
|
|
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
|
|
|
|
|
2009-12-04 17:20:24 +03:00
|
|
|
if(XIAR)
|
|
|
|
# INTERPROCEDURAL_OPTIMIZATION
|
|
|
|
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -ipo)
|
|
|
|
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY_IPO
|
|
|
|
"${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
|
|
|
"${XIAR} -s <TARGET> ")
|
|
|
|
endif()
|
|
|
|
endmacro()
|