CMakeASM_NASMInformation.cmake 1.5 KB

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