summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorEvgeny Fimochkin <fimochkin@gmail.com>2017-01-27 12:31:50 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-07 18:20:52 (GMT)
commit5ba2c9e5e08cb391c366065210a95a46ac74f310 (patch)
tree649d1bbb4922c4a195f7284c5eee0aba51d3f004 /Modules
parent0f4dae0a4da92af5079eb730443ec188b3b46f8e (diff)
downloadCMake-5ba2c9e5e08cb391c366065210a95a46ac74f310.zip
CMake-5ba2c9e5e08cb391c366065210a95a46ac74f310.tar.gz
CMake-5ba2c9e5e08cb391c366065210a95a46ac74f310.tar.bz2
VS: Add support for ASM_NASM language
Fixes: #16469
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake8
-rw-r--r--Modules/CMakeDetermineASM_NASMCompiler.cmake17
2 files changed, 23 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 4162726..66bf14b 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -92,6 +92,14 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMCC )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMCC "(ARM Compiler)|(ARM Assembler)")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS NASM)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_NASM "-v")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_NASM "(NASM version)")
+
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS YASM)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_YASM "--version")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_YASM "(yasm)")
+
include(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
index 4c8e422..dd75310 100644
--- a/Modules/CMakeDetermineASM_NASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -7,8 +7,21 @@
set(CMAKE_ASM_NASM_COMPILER_LIST nasm yasm)
if(NOT CMAKE_ASM_NASM_COMPILER)
- find_program(CMAKE_ASM_NASM_COMPILER nasm
- "$ENV{ProgramFiles}/NASM")
+ set(_CMAKE_ENV_VARX86 "ProgramFiles(x86)")
+ set(_CMAKE_ASM_NASM_COMPILER_PATHS
+ "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]"
+ "$ENV{ProgramFiles}/NASM"
+ "$ENV{${ENV_VARX86}}/NASM"
+ "$ENV{LOCALAPPDATA}/NASM"
+ )
+ find_program(CMAKE_ASM_NASM_COMPILER
+ NAMES ${CMAKE_ASM_NASM_COMPILER_LIST}
+ PATHS ${_CMAKE_ASM_NASM_COMPILER_PATHS}
+ NO_DEFAULT_PATH
+ DOC "NASM compiler"
+ )
+ unset(_CMAKE_ENV_VARX86)
+ unset(_CMAKE_ASM_NASM_COMPILER_PATHS)
endif()
# Load the generic DetermineASM compiler file with the DIALECT set properly: