2010-09-27 20:04:34 +04:00
|
|
|
|
|
|
|
#=============================================================================
|
2010-09-28 00:14:39 +04:00
|
|
|
# Copyright 2010 Kitware, Inc.
|
2010-09-27 20:04:34 +04:00
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
|
|
|
# License text for the above reference.)
|
|
|
|
|
2010-09-25 22:57:03 +04:00
|
|
|
# support for the nasm assembler
|
|
|
|
|
2010-10-21 22:51:46 +04:00
|
|
|
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
|
2010-09-25 22:57:03 +04:00
|
|
|
|
2010-11-12 22:27:18 +03:00
|
|
|
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
|
|
|
|
if(WIN32)
|
|
|
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
|
2010-11-12 22:27:18 +03:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
|
2010-11-12 22:27:18 +03:00
|
|
|
endif()
|
|
|
|
elseif(APPLE)
|
|
|
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
|
2010-11-12 22:27:18 +03:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
|
2010-11-12 22:27:18 +03:00
|
|
|
endif()
|
2010-09-25 22:57:03 +04:00
|
|
|
else()
|
2010-11-12 22:27:18 +03:00
|
|
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
2010-11-12 22:27:18 +03:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
|
2010-11-12 22:27:18 +03:00
|
|
|
endif()
|
2010-09-25 22:57:03 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2010-11-12 22:27:18 +03:00
|
|
|
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
|
2010-09-25 22:57:03 +04:00
|
|
|
|
|
|
|
# Load the generic ASMInformation file:
|
|
|
|
set(ASM_DIALECT "_NASM")
|
|
|
|
include(CMakeASMInformation)
|
|
|
|
set(ASM_DIALECT)
|