summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/dev/add-armcc-toolchain.rst4
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst1
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake1
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake4
-rw-r--r--Modules/Compiler/ARMCC-ASM.cmake7
-rw-r--r--Modules/Compiler/ARMCC-C.cmake2
-rw-r--r--Modules/Compiler/ARMCC-CXX.cmake2
-rw-r--r--Modules/Compiler/ARMCC-DetermineCompiler.cmake16
-rw-r--r--Modules/Compiler/ARMCC.cmake36
-rw-r--r--Modules/FindCUDA.cmake9
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCommonTargetGenerator.cxx4
-rw-r--r--Source/cmCommonTargetGenerator.h2
-rw-r--r--Source/cmGeneratorTarget.cxx16
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx13
18 files changed, 105 insertions, 25 deletions
diff --git a/Help/release/dev/add-armcc-toolchain.rst b/Help/release/dev/add-armcc-toolchain.rst
new file mode 100644
index 0000000..2cf6414
--- /dev/null
+++ b/Help/release/dev/add-armcc-toolchain.rst
@@ -0,0 +1,4 @@
+add-armcc-toolchain
+-------------------
+
+* Support was added for the ARM Compiler (arm.com) with compiler id ``ARMCC``.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 1c3b134..81976a9 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -11,6 +11,7 @@ include:
Absoft = Absoft Fortran (absoft.com)
ADSP = Analog VisualDSP++ (analog.com)
AppleClang = Apple Clang (apple.com)
+ ARMCC = ARM Compiler (arm.com)
CCur = Concurrent Fortran (ccur.com)
Clang = LLVM Clang (clang.llvm.org)
Cray = Cray Compiler (cray.com)
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index 19bcbcc..cbc0055 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -89,6 +89,7 @@ function(compiler_id_detection outvar lang)
MSVC
ADSP
IAR
+ ARMCC
)
if (lang STREQUAL C)
list(APPEND ordered_compilers
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 25af3e3..91111d2 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -92,6 +92,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS ARMCC)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMCC )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMCC "(ARM Compiler)|(ARM Assembler)")
+
include(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
diff --git a/Modules/Compiler/ARMCC-ASM.cmake b/Modules/Compiler/ARMCC-ASM.cmake
new file mode 100644
index 0000000..8e3cfc5
--- /dev/null
+++ b/Modules/Compiler/ARMCC-ASM.cmake
@@ -0,0 +1,7 @@
+include(Compiler/ARMCC)
+
+set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
+set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)
+
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
diff --git a/Modules/Compiler/ARMCC-C.cmake b/Modules/Compiler/ARMCC-C.cmake
new file mode 100644
index 0000000..dcdcaab
--- /dev/null
+++ b/Modules/Compiler/ARMCC-C.cmake
@@ -0,0 +1,2 @@
+include(Compiler/ARMCC)
+__compiler_armcc(C)
diff --git a/Modules/Compiler/ARMCC-CXX.cmake b/Modules/Compiler/ARMCC-CXX.cmake
new file mode 100644
index 0000000..811fc93
--- /dev/null
+++ b/Modules/Compiler/ARMCC-CXX.cmake
@@ -0,0 +1,2 @@
+include(Compiler/ARMCC)
+__compiler_armcc(CXX)
diff --git a/Modules/Compiler/ARMCC-DetermineCompiler.cmake b/Modules/Compiler/ARMCC-DetermineCompiler.cmake
new file mode 100644
index 0000000..a3667d7
--- /dev/null
+++ b/Modules/Compiler/ARMCC-DetermineCompiler.cmake
@@ -0,0 +1,16 @@
+# ARMCC Toolchain
+set(_compiler_id_pp_test "defined(__ARMCC_VERSION)")
+
+set(_compiler_id_version_compute "
+#if __ARMCC_VERSION >= 1000000
+ /* __ARMCC_VERSION = VRRPPPP */
+ # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ARMCC_VERSION/1000000)
+ # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ARMCC_VERSION/10000 % 100)
+ # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ARMCC_VERSION % 10000)
+#else
+ /* __ARMCC_VERSION = VRPPPP */
+ # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ARMCC_VERSION/100000)
+ # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ARMCC_VERSION/10000 % 10)
+ # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ARMCC_VERSION % 10000)
+#endif
+")
diff --git a/Modules/Compiler/ARMCC.cmake b/Modules/Compiler/ARMCC.cmake
new file mode 100644
index 0000000..3cf628c
--- /dev/null
+++ b/Modules/Compiler/ARMCC.cmake
@@ -0,0 +1,36 @@
+if(_ARMCC_CMAKE_LOADED)
+ return()
+endif()
+set(_ARMCC_CMAKE_LOADED TRUE)
+
+# See ARM Compiler documentation at:
+# http://infocenter.arm.com/help/topic/com.arm.doc.set.swdev/index.html
+
+get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
+
+set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+
+find_program(CMAKE_ARMCC_LINKER armlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
+find_program(CMAKE_ARMCC_AR armar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
+
+set(CMAKE_LINKER "${CMAKE_ARMCC_LINKER}" CACHE FILEPATH "The ARMCC linker" FORCE)
+mark_as_advanced(CMAKE_ARMCC_LINKER)
+set(CMAKE_AR "${CMAKE_ARMCC_AR}" CACHE FILEPATH "The ARMCC archiver" FORCE)
+mark_as_advanced(CMAKE_ARMCC_AR)
+
+macro(__compiler_armcc lang)
+ set(CMAKE_${lang}_FLAGS_INIT "")
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Ospace -DNDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-Otime -DNDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+
+ set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
+ set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1)
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map")
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--depend=<DEPFILE> --depend_single_line --no_depend_system_headers")
+endmacro()
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 1fc582f..6a21078 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -764,13 +764,9 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME)
if (NOT APPLE)
# Here is librt that has things such as, clock_gettime, shm_open, and shm_unlink.
find_library(CUDA_rt_LIBRARY rt)
- find_library(CUDA_dl_LIBRARY dl)
if (NOT CUDA_rt_LIBRARY)
message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.")
endif()
- if (NOT CUDA_dl_LIBRARY)
- message(WARNING "Expecting to find libdl for libcudart_static, but didn't find it.")
- endif()
endif()
endif()
endif()
@@ -793,13 +789,10 @@ set(CUDA_LIBRARIES)
if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY)
- list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
+ list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
if (CUDA_rt_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY})
endif()
- if (CUDA_dl_LIBRARY)
- list(APPEND CUDA_LIBRARIES ${CUDA_dl_LIBRARY})
- endif()
if(APPLE)
# We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
# the static cuda runtime can find it at runtime.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 814f0ef..c048a0a 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 4)
-set(CMake_VERSION_PATCH 20151103)
+set(CMake_VERSION_PATCH 20151104)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index bd47715..76ed038 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -81,7 +81,7 @@ void cmCommonTargetGenerator::AddFeatureFlags(
//----------------------------------------------------------------------------
void cmCommonTargetGenerator::AddModuleDefinitionFlag(std::string& flags)
{
- if(this->ModuleDefinitionFile.empty())
+ if(!this->ModuleDefinitionFile)
{
return;
}
@@ -98,7 +98,7 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(std::string& flags)
// vs6's "cl -link" pass it to the linker.
std::string flag = defFileFlag;
flag += (this->LocalGenerator->ConvertToLinkReference(
- this->ModuleDefinitionFile));
+ this->ModuleDefinitionFile->GetFullPath()));
this->LocalGenerator->AppendFlags(flags, flag);
}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 3fb1fd0..0c17500 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -54,7 +54,7 @@ protected:
std::string ConfigName;
// The windows module definition source file (.def), if any.
- std::string ModuleDefinitionFile;
+ cmSourceFile const* ModuleDefinitionFile;
// Target-wide Fortran module output directory.
bool FortranModuleDirectoryComputed;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1f74eda..40afc0e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -573,7 +573,7 @@ static void handleSystemIncludesDep(cmLocalGenerator *lg,
{ \
std::vector<cmSourceFile*> sourceFiles; \
this->GetSourceFiles(sourceFiles, config); \
- TagVisitor<DATA ## Tag DATATYPE> visitor(this, data); \
+ TagVisitor< DATA##Tag DATATYPE > visitor(this, data); \
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
si != sourceFiles.end(); ++si) \
{ \
@@ -2095,12 +2095,18 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
}
//----------------------------------------------------------------------------
-std::string
+cmSourceFile const*
cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
{
- std::string data;
- IMPLEMENT_VISIT_IMPL(ModuleDefinitionFile, COMMA std::string)
- return data;
+ std::vector<cmSourceFile const*> data;
+ IMPLEMENT_VISIT_IMPL(ModuleDefinitionFile,
+ COMMA std::vector<cmSourceFile const*>)
+ if(!data.empty())
+ {
+ return data.front();
+ }
+
+ return 0;
}
bool cmGeneratorTarget::IsDLLPlatform() const
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index da59a98..bd23477 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -220,7 +220,7 @@ public:
cmLocalGenerator* LocalGenerator;
cmGlobalGenerator const* GlobalGenerator;
- std::string GetModuleDefinitionFile(const std::string& config) const;
+ cmSourceFile const* GetModuleDefinitionFile(const std::string& config) const;
/** Return whether or not the target is for a DLL platform. */
bool IsDLLPlatform() const;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 7acccb3..eedc6ab 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1497,9 +1497,9 @@ void cmMakefileTargetGenerator
this->AppendTargetDepends(depends);
// Add a dependency on the link definitions file, if any.
- if(!this->ModuleDefinitionFile.empty())
+ if(this->ModuleDefinitionFile)
{
- depends.push_back(this->ModuleDefinitionFile);
+ depends.push_back(this->ModuleDefinitionFile->GetFullPath());
}
// Add a dependency on user-specified manifest files, if any.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index dc2c7a6..5ff4fdb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -195,9 +195,10 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
// Add a dependency on the link definitions file, if any.
- if(!this->ModuleDefinitionFile.empty())
+ if(this->ModuleDefinitionFile)
{
- result.push_back(this->ConvertToNinjaPath(this->ModuleDefinitionFile));
+ result.push_back(this->ConvertToNinjaPath(
+ this->ModuleDefinitionFile->GetFullPath()));
}
// Add a dependency on user-specified manifest files, if any.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7da00fa..6e1fb5b 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1613,6 +1613,12 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
(*this->BuildFileStream ) << cmVS10EscapeXML(obj) << "\" />\n";
}
+ if (cmSourceFile const* defsrc =
+ this->GeneratorTarget->GetModuleDefinitionFile(""))
+ {
+ this->WriteSource("None", defsrc);
+ }
+
if (this->IsMissingFiles)
{
this->WriteMissingFiles();
@@ -2642,10 +2648,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
if(this->MSTools)
{
- std::string def = this->GeneratorTarget->GetModuleDefinitionFile("");
- if(!def.empty())
+ if (cmSourceFile const* defsrc =
+ this->GeneratorTarget->GetModuleDefinitionFile(""))
{
- linkOptions.AddFlag("ModuleDefinitionFile", def.c_str());
+ linkOptions.AddFlag("ModuleDefinitionFile",
+ defsrc->GetFullPath().c_str());
}
linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries",
"%(IgnoreSpecificDefaultLibraries)");