From 0628a1f9f3b189fceafaa2e370e72d2b9710def6 Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Sun, 8 Dec 2013 15:24:42 +0100 Subject: [PATCH] Exclude threadasm.S from build if CMake version is less than 2.8.5. Assembler support was rewritten in CMake 2.8.5. The new functionality is required to assemble the file, otherwise a bunch of error messages is generated. The solution is to exclude the file from the build. This is only a problem for non-x86 platforms (PPC, Mips). General advise is to use at least CMake 2.8.5. This fixes #464. --- runtime/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index f5fd158f..e10d9de2 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -102,7 +102,18 @@ if(UNIX) if(${CMAKE_SYSTEM} MATCHES "Linux") list(APPEND CORE_D_SYS ${CORE_D_LINUX}) endif() - list(APPEND DCRT_ASM ${RUNTIME_DIR}/src/core/threadasm.S) + # Assembler support was rewritten in CMake 2.8.5. + # The assembler file must be passed to gcc but prior to this + # version it is passed to as. This results in a bunch of + # error message. This is only critical for non-x86 platforms. + # On x86/x86-64 the file can safely be ignored. + if("${CMAKE_VERSION}" MATCHES "^2\\.8\\.[01234]($|\\..*)") + message(WARNING "Excluding core/threadasm.S from build because of missing CMake support.") + message(WARNING "This file is required for certain non-x86 platforms.") + message(WARNING "Please consider updating CMake to at least 2.8.5.") + else() + list(APPEND DCRT_ASM ${RUNTIME_DIR}/src/core/threadasm.S) + endif() if(APPLE) list(APPEND CORE_D_SYS ${CORE_D_OSX}) endif()