From 39313e7735850f2e37a443f984a067fd8515f96c Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 27 May 2013 20:06:51 +0200 Subject: [PATCH] Ugly workaround for broken asm support in older CMake versions. The only justification for this is the fact that we need it to work for the release process. --- runtime/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 7f9b4dc5..2fa68c76 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -115,6 +115,19 @@ list(APPEND CORE_D ${CORE_D_SYNC} ${CORE_D_SYS} ${CORE_D_STDC}) list(APPEND CORE_D ${LDC_D} ${RUNTIME_DIR}/src/object_.d) file(GLOB CORE_C ${RUNTIME_DIR}/src/core/stdc/*.c) +# CMake 2.8.0 on Ubuntu 10.04 LTS chooses /usr/bin/as for the as compiler +# instead of passing the file through GCC. Other old CMake versions may be +# affected too, but said configuration is critical because it is the officialy +# "blessed" host platform for the release packages. The workaround relies on +# the fact that the default C compiler is GCC (or compatibile), the driver of +# which intelligently handles the different input file types. +if(CMAKE_VERSION VERSION_LESS "2.8.1") + if(UNIX) + message(WARNING "CMake version known not to handle druntime asm source files correctly, forcing them to be treated as C.") + set_source_files_properties(${DCRT_ASM} PROPERTIES LANGUAGE C) + endif() +endif() + if(PHOBOS2_DIR) if(BUILD_SHARED_LIBS) # std.net.curl depends on libcurl – when building a shared library, we