Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Modules / Platform / Linux-IntelLLVM.cmake
1 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
3
4
5 # This module is shared by multiple languages; use include blocker.
6 if(__LINUX_COMPILER_INTEL_LLVM)
7   return()
8 endif()
9 set(__LINUX_COMPILER_INTEL_LLVM 1)
10
11 macro(__linux_compiler_intel_llvm lang)
12   set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
13   set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
14   set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
15   set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
16   set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie")
17   set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie")
18   set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
19   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
20
21   # We pass this for historical reasons.  Projects may have
22   # executables that use dlopen but do not set ENABLE_EXPORTS.
23   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
24
25   set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
26   set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
27
28   set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
29 endmacro()