diff options
Diffstat (limited to 'Modules/CMakeASM_NASMInformation.cmake')
-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) |