diff options
author | Christian Feldmann <christian.feldmann@bitmovin.com> | 2020-04-20 14:35:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-20 15:07:30 (GMT) |
commit | 3328e0a3876afba2e1521391b0d31ea72a1a1f10 (patch) | |
tree | d511cf3e51181a4855061c0434444379804ac4ec | |
parent | 348a2a9734d7a8dd07a44afdcee47acbf6fa3dc2 (diff) | |
download | CMake-3328e0a3876afba2e1521391b0d31ea72a1a1f10.zip CMake-3328e0a3876afba2e1521391b0d31ea72a1a1f10.tar.gz CMake-3328e0a3876afba2e1521391b0d31ea72a1a1f10.tar.bz2 |
NASM: Fix object format when CXX is enabled but not C
Check CXX data pointer size if C is not set.
-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) |