Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 1 | # |
| 2 | #//===----------------------------------------------------------------------===// |
| 3 | #// |
| 4 | #// The LLVM Compiler Infrastructure |
| 5 | #// |
| 6 | #// This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | #// Source Licenses. See LICENSE.txt for details. |
| 8 | #// |
| 9 | #//===----------------------------------------------------------------------===// |
| 10 | # |
| 11 | |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 12 | # This file holds Intel(R) C Compiler / Intel(R) C++ Compiler / Intel(R) Fortran Compiler (icc/icpc/icl.exe/ifort) dependent flags |
| 13 | # The flag types are: |
| 14 | # 1) Assembly flags |
| 15 | |
| 16 | ######################################################### |
| 17 | # Assembly flags |
| 18 | function(append_assembler_specific_asm_flags input_asm_flags) |
| 19 | set(local_asm_flags) |
| 20 | append_asm_flags("-x assembler-with-cpp") # Assembly file that needs to be preprocessed |
| 21 | if(${IA32}) |
| 22 | append_asm_flags("-safeseh") # Registers exception handlers for safe exception handling. |
| 23 | append_asm_flags("-coff") # Generates common object file format (COFF) type of object module. |
| 24 | # Generally required for Win32 assembly language development. |
| 25 | append_asm_flags("-D _M_IA32") |
| 26 | elseif(${INTEL64}) |
| 27 | append_asm_flags("-D _M_AMD64") |
| 28 | endif() |
| 29 | if(${MIC}) |
| 30 | append_asm_flags("-mmic") # Build Intel(R) MIC Architecture native code |
| 31 | endif() |
| 32 | if(${WINDOWS}) |
| 33 | # CMake prefers the /MD flags when compiling Windows sources, but libiomp5 needs to use /MT instead |
| 34 | # So we replace these /MD instances with /MT within the CMAKE_*_FLAGS variables and put that out to the CACHE. |
| 35 | # replace_md_with_mt() is in HelperFunctions.cmake |
| 36 | replace_md_with_mt(CMAKE_ASM_MASM_FLAGS) |
| 37 | replace_md_with_mt(CMAKE_ASM_MASM_FLAGS_RELEASE) |
| 38 | replace_md_with_mt(CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO) |
| 39 | replace_md_with_mt(CMAKE_ASM_MASM_FLAGS_DEBUG) |
| 40 | endif() |
| 41 | set(${input_asm_flags} ${${input_asm_flags}} "${local_asm_flags}" PARENT_SCOPE) |
| 42 | endfunction() |