VS: Add test for MASM support

It is now expected to work with VS >= 10 and MSVC >= 13.1.
This commit is contained in:
Brad King 2014-08-07 14:53:57 -04:00
parent e872744990
commit df3b007d7f
5 changed files with 28 additions and 0 deletions

View File

@ -1679,6 +1679,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC")
endif() endif()
if(MSVC AND NOT MSVC_VERSION LESS 1310
AND NOT CMAKE_GENERATOR MATCHES "Visual Studio [6789]( |$)")
ADD_TEST_MACRO(VSMASM VSMASM)
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio") if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
if(NOT MSVC60) if(NOT MSVC60)
ADD_TEST_MACRO(SBCS SBCS) ADD_TEST_MACRO(SBCS SBCS)

View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 2.8.12)
project(VSMASM C ASM_MASM)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DTESTx64)
else()
add_definitions(-DTESTi386)
set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /safeseh")
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(VSMASM main.c foo.asm)

7
Tests/VSMASM/foo.asm Normal file
View File

@ -0,0 +1,7 @@
ifndef TESTx64
.386
.model flat, c
endif
.code
include <foo-proc.asm>
end

View File

@ -0,0 +1,4 @@
foo proc public
mov eax,0
ret
foo endp

2
Tests/VSMASM/main.c Normal file
View File

@ -0,0 +1,2 @@
extern int foo(void);
int main(void) { return foo(); }