CMakeDetermineASM_NASMCompiler.cmake 937 B

123456789101112131415161718192021222324252627282930
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
  4. set(CMAKE_ASM_NASM_COMPILER_LIST nasm yasm)
  5. if(NOT CMAKE_ASM_NASM_COMPILER)
  6. set(_CMAKE_ENV_VARX86 "ProgramFiles(x86)")
  7. set(_CMAKE_ASM_NASM_COMPILER_PATHS
  8. "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]"
  9. "$ENV{ProgramFiles}/NASM"
  10. "$ENV{${ENV_VARX86}}/NASM"
  11. "$ENV{LOCALAPPDATA}/NASM"
  12. )
  13. find_program(CMAKE_ASM_NASM_COMPILER
  14. NAMES ${CMAKE_ASM_NASM_COMPILER_LIST}
  15. PATHS ${_CMAKE_ASM_NASM_COMPILER_PATHS}
  16. NO_DEFAULT_PATH
  17. DOC "NASM compiler"
  18. )
  19. unset(_CMAKE_ENV_VARX86)
  20. unset(_CMAKE_ASM_NASM_COMPILER_PATHS)
  21. endif()
  22. # Load the generic DetermineASM compiler file with the DIALECT set properly:
  23. set(ASM_DIALECT "_NASM")
  24. include(CMakeDetermineASMCompiler)
  25. set(ASM_DIALECT)