Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / CMakeASM_NASMInformation.cmake
1
2 #=============================================================================
3 # Copyright 2010 Kitware, Inc.
4 #
5 # Distributed under the OSI-approved BSD License (the "License");
6 # see accompanying file Copyright.txt for details.
7 #
8 # This software is distributed WITHOUT ANY WARRANTY; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # See the License for more information.
11 #=============================================================================
12 # (To distribute this file outside of CMake, substitute the full
13 #  License text for the above reference.)
14
15 # support for the nasm assembler
16
17 set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
18
19 if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
20   if(WIN32)
21     if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
22       set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
23     else()
24       set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
25     endif()
26   elseif(APPLE)
27     if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
28       set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
29     else()
30       set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
31     endif()
32   else()
33     if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
34       set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
35     else()
36       set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
37     endif()
38   endif()
39 endif()
40
41 set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
42
43 # Load the generic ASMInformation file:
44 set(ASM_DIALECT "_NASM")
45 include(CMakeASMInformation)
46 set(ASM_DIALECT)