From 8dea63e8a82955d4b44b19cfbb64f407ac40f76a Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 25 May 2012 19:07:57 +0200 Subject: [PATCH] Fix #98 - Build broken using CMake 2.8.8. As per the CMake docs, LANGUAGE is only to be set for files that are actually compiled. In versions prior to 2.8.7, setting it globally worked fine nevertheless. --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4065d0f..5c79b2ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,10 +224,13 @@ set(LDC_SOURCE_FILES ${GEN_SRC} ${IR_SRC} ) -set_source_files_properties( - ${LDC_SOURCE_FILES} PROPERTIES - LANGUAGE CXX -) + +# DMD source files have a .c extension, but are actually C++ code. +foreach(file ${LDC_SOURCE_FILES}) + if(file MATCHES ".*\\.c$") + set_source_files_properties(${file} PROPERTIES LANGUAGE CXX) + endif() +endforeach() # # Includes, defines.