diff options
author | Brad King <brad.king@kitware.com> | 2017-02-10 13:36:18 -0500 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-02-10 13:36:18 -0500 |
commit | ee3295e91740033ebe9d9a0c800c0a3070108624 (patch) | |
tree | a8ef6ee556baa5d8898e2e7617927b53c2da9811 /Modules | |
parent | 0a30938848518a0e5095a5dd7e4739922a78b743 (diff) | |
parent | 5ba2c9e5e08cb391c366065210a95a46ac74f310 (diff) | |
download | cmake-ee3295e91740033ebe9d9a0c800c0a3070108624.tar.gz |
Merge topic 'vs-nasm'
5ba2c9e5 VS: Add support for ASM_NASM language
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 8 | ||||
-rw-r--r-- | Modules/CMakeDetermineASM_NASMCompiler.cmake | 17 |
2 files changed, 23 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 3f18a8c239..7d5e2b2089 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) set(userflags) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}") diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake index 4c8e422921..dd75310314 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: |