diff options
author | Brad King <brad.king@kitware.com> | 2020-04-21 12:17:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-21 12:17:43 (GMT) |
commit | 22d2354ec5909ad8de3d6eea75554852076c8939 (patch) | |
tree | 5d9313e4163a35f09d1d84ed4128d57447f60349 /Modules | |
parent | cd957389f240425ddec809f72d3885f024a03df1 (diff) | |
parent | 3328e0a3876afba2e1521391b0d31ea72a1a1f10 (diff) | |
download | CMake-22d2354ec5909ad8de3d6eea75554852076c8939.zip CMake-22d2354ec5909ad8de3d6eea75554852076c8939.tar.gz CMake-22d2354ec5909ad8de3d6eea75554852076c8939.tar.bz2 |
Merge topic 'nasm-with-CXX'
3328e0a387 NASM: Fix object format when CXX is enabled but not C
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4642
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeASM_NASMInformation.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake index cb793e7..97cb488 100644 --- a/Modules/CMakeASM_NASMInformation.cmake +++ b/Modules/CMakeASM_NASMInformation.cmake @@ -8,19 +8,25 @@ set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm) if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT) if(WIN32) - if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) + if(DEFINED CMAKE_C_SIZEOF_DATA_PTR AND CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) + set(CMAKE_ASM_NASM_OBJECT_FORMAT win64) + elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8) set(CMAKE_ASM_NASM_OBJECT_FORMAT win64) else() set(CMAKE_ASM_NASM_OBJECT_FORMAT win32) endif() elseif(APPLE) - if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) + if(DEFINED CMAKE_C_SIZEOF_DATA_PTR AND CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) + set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64) + elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8) set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64) else() set(CMAKE_ASM_NASM_OBJECT_FORMAT macho) endif() else() - if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) + if(DEFINED CMAKE_C_SIZEOF_DATA_PTR AND CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) + set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) + elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8) set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) else() set(CMAKE_ASM_NASM_OBJECT_FORMAT elf) |