-
-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build outside source dir #12
Conversation
@@ -281,11 +290,18 @@ if(BUILD_BC_LIBS) | |||
set(BCLIBS bclibs) | |||
endif(BUILD_BC_LIBS) | |||
|
|||
if(D_VERSION EQUAL 2) | |||
if(NOT ROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}") | |||
file(COPY ${PROJECT_PARENT_DIR}/${RUNTIME} DESTINATION ${PROJECT_BINARY_DIR}/../) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes typo, thanks
install(FILES ${PROJECT_SOURCE_DIR}/bin/${LDC_EXE}.rebuild.conf DESTINATION ${CONF_INST_DIR}) | ||
install(FILES ${library} DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
|
||
if(NOT "" STREQUAL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the result of a search/replace accident…
oh yes right i miss remove this code, unused since chroot_install_dir is removed |
set(CONF_INST_DIR ${SYSCONF_INSTALL_DIR} CACHE PATH "Set ldc.conf directory for installation") | ||
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX} CACHE PATH "output dir for built libraries") | ||
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/d CACHE PATH "Directory where will be put header files") | ||
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build as shared library or as static library") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it enabled by default? It probably works only on linux.
Since this pull request became quite a mess over time, I merged a slightly cleaned up version (less whitespace changes, removed the unused |
…ter types returned by semantic(). Sometimes types aren't merged and their deco are copied manually, do the same for equivDeco so function overriding works properly.
Unlike Clang, LDC flattens anon structs into the parent's LLVM struct type: %withanonstruct_d = type { i32, float, i8, [3 x i8] } ; LDC %struct.withanonstruct_cpp = type { i32, %struct.anon } ; Clang %struct.anon = type { float, i8 } Same goes for base classes and anonymous unions, so Calypso shouldn't access fields through LDC's flat varGEPIndices. This didn't cause issues with base classes because the derived class pointer is always bitcast to the base one, but it did break if buildGEPIndices was querying the LLVM field number for an injected field. Letting Clang handle the GEP construction is a more robust approach, and this fixes the segfault during codegen while compiling wilsonk's FastFlow demo (ldc-developers#12).
Default ctors and dtors of records that are implicitly called if a field is one such record may not appear anywhere in its parent AST node. Fixes the remaining linking error from ldc-developers#12.
Clang was already trying to emit a global ctor/dtor for global variables, but assumed wrong that @llvm.global_ctors didn't exist. This fixes the segfault of the FastFlow example by wilsonk (ldc-developers#12).
Fix build outside source dir