From 1805e534b230cf73b10d49c7252a8f627f3e7e0d Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 25 May 2012 15:54:42 +0200 Subject: [PATCH 1/3] Fix issue 97 - <<= broken for LDC 1. This code path was introduced in the 1.074 merge. --- dmd/expression.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dmd/expression.c b/dmd/expression.c index f11893df..ab6e036e 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -5497,7 +5497,11 @@ Expression *BinAssignExp::semantic(Scope *sc) typeCombine(sc); e1->checkIntegral(); e2 = e2->checkIntegral(); +#if !IN_LLVM e2 = e2->castTo(sc, Type::tshiftcnt); +#else + e2 = e2->castTo(sc, e1->type); +#endif return this; } From 8dea63e8a82955d4b44b19cfbb64f407ac40f76a Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 25 May 2012 19:07:57 +0200 Subject: [PATCH 2/3] 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. From 1f5bced327b7bd0facee2cbd4052b6918599d3b9 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 25 May 2012 19:41:33 +0200 Subject: [PATCH 3/3] Don't install libldc for static builds. --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c79b2ce..f650ea76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -324,11 +324,16 @@ get_target_property(LDC_LOC ${LDC_EXE} LOCATION) add_subdirectory(runtime) -install(TARGETS ${LDC_EXE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -install(TARGETS ${LDC_LIB} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) -install(PROGRAMS ${PROJECT_SOURCE_DIR}/bin/${LDMD_EXE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}_install.conf DESTINATION ${CONF_INST_DIR} RENAME ${LDC_EXE}.conf) -install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}_install.rebuild.conf DESTINATION ${CONF_INST_DIR} RENAME ${LDC_EXE}.rebuild.conf) +install(TARGETS ${LDC_EXE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +if(${BUILD_SHARED}) + # For now, only install libldc if explicitely building the shared library. + # While it might theoretically be possible to use LDC as a static library + # as well, for the time being this just bloats the normal packages. + install(TARGETS ${LDC_LIB} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +endif() +install(PROGRAMS ${PROJECT_SOURCE_DIR}/bin/${LDMD_EXE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}_install.conf DESTINATION ${CONF_INST_DIR} RENAME ${LDC_EXE}.conf) +install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}_install.rebuild.conf DESTINATION ${CONF_INST_DIR} RENAME ${LDC_EXE}.rebuild.conf) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") install(DIRECTORY bash_completion.d DESTINATION ${CONF_INST_DIR})