Author: akhaldi
Date: Mon May 26 15:28:12 2014
New Revision: 63468
URL:
http://svn.reactos.org/svn/reactos?rev=63468&view=rev
Log:
[CMAKE/ARM]
* Add armasm assembler support. Inspired by Yuntian Zhang's patch.
CORE-7439
Modified:
trunk/reactos/cmake/msvc.cmake
trunk/reactos/toolchain-msvc.cmake
Modified: trunk/reactos/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=63468…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Mon May 26 15:28:12 2014
@@ -103,9 +103,15 @@
set(rc_nologo_flag)
endif()
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_nologo_flag}
<FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")
- set(CMAKE_ASM_COMPILE_OBJECT
- "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm
/I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP
/c <SOURCE> > <OBJECT>.tmp"
- "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta
<OBJECT>.tmp")
+ if(ARCH STREQUAL "arm")
+ set(CMAKE_ASM_COMPILE_OBJECT
+ "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm
/I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP
/c <SOURCE> > <OBJECT>.tmp"
+ "<CMAKE_ASM_COMPILER> -nologo -o <OBJECT>
<OBJECT>.tmp")
+ else()
+ set(CMAKE_ASM_COMPILE_OBJECT
+ "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm
/I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP
/c <SOURCE> > <OBJECT>.tmp"
+ "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta
<OBJECT>.tmp")
+ endif()
endif()
if(_VS_ANALYZE_)
@@ -222,7 +228,13 @@
# Define those for having real libraries
set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO <LINK_FLAGS>
/OUT:<TARGET> <OBJECTS>")
-set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /nologo /Cp
/Fo<OBJECT> /c /Ta <SOURCE>")
+
+if(ARCH STREQUAL "arm")
+ set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -nologo -o
<OBJECT> <SOURCE>")
+else()
+ set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /nologo /Cp
/Fo<OBJECT> /c /Ta <SOURCE>")
+endif()
+
function(add_delay_importlibs _module)
get_target_property(_module_type ${_module} TYPE)
if(_module_type STREQUAL "STATIC_LIBRARY")
@@ -248,9 +260,14 @@
if(MSVC_IDE)
# Compile the generated asm stub file
+ if(ARCH STREQUAL "arm")
+ set(_asm_stub_command ${CMAKE_ASM_COMPILER} -nologo -o ${_asm_stubs_file}.obj
${_asm_stubs_file})
+ else()
+ set(_asm_stub_command ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c
/Ta ${_asm_stubs_file})
+ endif()
add_custom_command(
OUTPUT ${_asm_stubs_file}.obj
- COMMAND ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c /Ta
${_asm_stubs_file}
+ COMMAND ${_asm_stub_command}
DEPENDS ${_asm_stubs_file})
else()
# Be clear about the "language"
@@ -276,6 +293,9 @@
if(ARCH STREQUAL "amd64")
add_definitions(/D__x86_64)
set(SPEC2DEF_ARCH x86_64)
+elseif(ARCH STREQUAL "arm")
+ add_definitions(/D__arm__)
+ set(SPEC2DEF_ARCH arm)
else()
set(SPEC2DEF_ARCH i386)
endif()
@@ -320,6 +340,8 @@
# both the x86 and x64 versions of ml are available.
if((ARCH STREQUAL "amd64") AND (DEFINED ENV{VCINSTALLDIR}))
set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe)
+elseif(ARCH STREQUAL "arm")
+ set(CMAKE_ASM16_COMPILER armasm.exe)
else()
set(CMAKE_ASM16_COMPILER ml.exe)
endif()
@@ -333,9 +355,15 @@
COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm
/I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c ${_asm_file} >
${_temp_file}
DEPENDS ${_asm_file})
+ if(ARCH STREQUAL "arm")
+ set(_asm16_command ${CMAKE_ASM16_COMPILER} -nologo -o ${_object_file}
${_temp_file})
+ else()
+ set(_asm16_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta
${_temp_file})
+ endif()
+
add_custom_command(
OUTPUT ${_object_file}
- COMMAND ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta
${_temp_file}
+ COMMAND ${_asm16_command}
DEPENDS ${_temp_file})
add_custom_command(
@@ -368,9 +396,14 @@
list(APPEND _source_file_defines -D${_define})
endif()
endforeach()
+ if(ARCH STREQUAL "arm")
+ set(_pp_asm_compile_command ${CMAKE_ASM_COMPILER} -nologo -o
${_object_file} ${_preprocessed_asm_file})
+ else()
+ set(_pp_asm_compile_command ${CMAKE_ASM_COMPILER} /nologo /Cp
/Fo${_object_file} /c /Ta ${_preprocessed_asm_file})
+ endif()
add_custom_command(
OUTPUT ${_preprocessed_asm_file} ${_object_file}
- COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm
/I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines}
${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} >
${_preprocessed_asm_file} && ${CMAKE_ASM_COMPILER} /nologo /Cp /Fo${_object_file}
/c /Ta ${_preprocessed_asm_file}
+ COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm
/I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines}
${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} >
${_preprocessed_asm_file} && ${_pp_asm_compile_command}
DEPENDS ${_source_file_full_path})
set_source_files_properties(${_object_file} PROPERTIES EXTERNAL_OBJECT 1)
list(APPEND ${_target} ${_object_file})
Modified: trunk/reactos/toolchain-msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/toolchain-msvc.cmake?rev=6…
==============================================================================
--- trunk/reactos/toolchain-msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/toolchain-msvc.cmake [iso-8859-1] Mon May 26 15:28:12 2014
@@ -21,6 +21,8 @@
set(CMAKE_RC_COMPILER rc)
if(ARCH STREQUAL "amd64")
set(CMAKE_ASM_COMPILER ml64)
+elseif(ARCH STREQUAL "arm")
+ set(CMAKE_ASM_COMPILER armasm)
else()
set(CMAKE_ASM_COMPILER ml)
endif()