CMakeASM_NASMInformation.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # support for the nasm assembler
  4. set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
  5. if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
  6. if(WIN32)
  7. if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
  8. set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
  9. else()
  10. set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
  11. endif()
  12. elseif(APPLE)
  13. if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
  14. set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
  15. else()
  16. set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
  17. endif()
  18. else()
  19. if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
  20. set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
  21. else()
  22. set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
  23. endif()
  24. endif()
  25. endif()
  26. if(NOT CMAKE_ASM_NASM_COMPILE_OBJECT)
  27. set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
  28. endif()
  29. # Load the generic ASMInformation file:
  30. set(ASM_DIALECT "_NASM")
  31. include(CMakeASMInformation)
  32. set(ASM_DIALECT)