CMakeASM_NASMInformation.cmake 1.06 KB
Newer Older
1 2
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
3 4


5 6
# support for the nasm assembler

7
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
8

9 10 11
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
  if(WIN32)
    if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
12
      set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
13
    else()
14
      set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
15 16 17
    endif()
  elseif(APPLE)
    if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
18
      set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
19
    else()
20
      set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
21
    endif()
22
  else()
23
    if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
24
      set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
25
    else()
26
      set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
27
    endif()
28 29 30
  endif()
endif()

31 32 33
if(NOT CMAKE_ASM_NASM_COMPILE_OBJECT)
  set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
endif()
34 35 36 37 38

# Load the generic ASMInformation file:
set(ASM_DIALECT "_NASM")
include(CMakeASMInformation)
set(ASM_DIALECT)