diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-22 09:45:43 -0700 |
---|---|---|
committer | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-23 22:54:56 -0700 |
commit | ad7c799eb9a2ae1e7371c75655d4b244e196b239 (patch) | |
tree | c2277470b41fce032020eab4a85dbcda5ad82fdc /functions.cmake | |
parent | d7821eb792915fa64ff6219c7ce4b9abc195ab7e (diff) | |
download | coreclr-ad7c799eb9a2ae1e7371c75655d4b244e196b239.tar.gz coreclr-ad7c799eb9a2ae1e7371c75655d4b244e196b239.tar.bz2 coreclr-ad7c799eb9a2ae1e7371c75655d4b244e196b239.zip |
Initial commit to build Win32 Arm CoreCLR
Diffstat (limited to 'functions.cmake')
-rw-r--r-- | functions.cmake | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/functions.cmake b/functions.cmake index bbc571b46d..df2216c885 100644 --- a/functions.cmake +++ b/functions.cmake @@ -1,6 +1,6 @@ function(clr_unknown_arch) if (WIN32) - message(FATAL_ERROR "Only AMD64, ARM64 and I386 are supported") + message(FATAL_ERROR "Only AMD64, ARM64, ARM and I386 are supported") else() message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported") endif() @@ -24,15 +24,40 @@ function(get_compile_definitions DefinitionName) set(${DefinitionName} ${DEFINITIONS} PARENT_SCOPE) endfunction(get_compile_definitions) -# Build a list of include directories by putting -I in front of each include dir. +# Build a list of include directories function(get_include_directories IncludeDirectories) get_directory_property(dirs INCLUDE_DIRECTORIES) foreach(dir IN LISTS dirs) + + if (CLR_CMAKE_PLATFORM_ARCH_ARM AND WIN32) + list(APPEND INC_DIRECTORIES /I${dir}) + else() list(APPEND INC_DIRECTORIES -I${dir}) + endif(CLR_CMAKE_PLATFORM_ARCH_ARM AND WIN32) + endforeach() set(${IncludeDirectories} ${INC_DIRECTORIES} PARENT_SCOPE) endfunction(get_include_directories) +# Build a list of include directories for consumption by the assembler +function(get_include_directories_asm IncludeDirectories) + get_directory_property(dirs INCLUDE_DIRECTORIES) + + if (CLR_CMAKE_PLATFORM_ARCH_ARM AND WIN32) + list(APPEND INC_DIRECTORIES "-I ") + endif() + + foreach(dir IN LISTS dirs) + if (CLR_CMAKE_PLATFORM_ARCH_ARM AND WIN32) + list(APPEND INC_DIRECTORIES ${dir};) + else() + list(APPEND INC_DIRECTORIES -I${dir}) + endif() + endforeach() + + set(${IncludeDirectories} ${INC_DIRECTORIES} PARENT_SCOPE) +endfunction(get_include_directories_asm) + # Set the passed in RetSources variable to the list of sources with added current source directory # to form absolute paths. # The parameters after the RetSources are the input files. @@ -52,7 +77,7 @@ function(preprocess_def_file inputFilename outputFilename) OUTPUT ${outputFilename} COMMAND ${CMAKE_CXX_COMPILER} ${ASM_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename} DEPENDS ${inputFilename} - COMMENT "Preprocessing ${inputFilename}" + COMMENT "Preprocessing ${inputFilename} - ${CMAKE_CXX_COMPILER} ${ASM_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename}" ) set_source_files_properties(${outputFilename} |