diff --git a/.github/actions/3-build-cross/action.yml b/.github/actions/3-build-cross/action.yml index d8c779d5df0..303f6e5557d 100644 --- a/.github/actions/3-build-cross/action.yml +++ b/.github/actions/3-build-cross/action.yml @@ -140,6 +140,8 @@ runs: --buildDir="build-cross-libs" \ --dFlags="${DFLAGS// /;}" \ --ldcSrcDir="$PWD/ldc" \ + CMAKE_INSTALL_PREFIX="$PWD/install" \ + INCLUDE_INSTALL_DIR="$PWD/install/import" \ "${flags[@]}" - name: Cross-compile LDC executables @@ -155,4 +157,3 @@ runs: ${{ inputs.cmake_flags }} ${{ inputs.with_pgo == 'true' && '-DDFLAGS_LDC=-fprofile-use=../pgo-ldc/merged.profdata' || '' }} ${{ env.CROSS_CMAKE_FLAGS }} - build_targets: ldc2 ldmd2 ldc-build-runtime ldc-build-plugin ldc-profdata ldc-profgen ldc-prune-cache timetrace2txt diff --git a/.github/actions/5-install/action.yml b/.github/actions/5-install/action.yml index 563bb95a731..ab855bffd1d 100644 --- a/.github/actions/5-install/action.yml +++ b/.github/actions/5-install/action.yml @@ -18,20 +18,20 @@ runs: if [[ '${{ inputs.cross_compiling }}' != true ]]; then ninja -C build install >/dev/null else - mkdir -p install/bin - cp build-cross/bin/{ldc2,ldmd2,ldc-build-runtime,ldc-profdata,ldc-profgen,ldc-prune-cache,timetrace2txt} install/bin/ - cp build-cross/bin/ldc-build-plugin install/bin/ || true + # populate first subdirs by installing the cross-compiled compiler: + # * bin/: executables + # * lib/: LTO plugin and compiler-rt libs only + # * etc/bash_completion.d/ + # * import/: missing ldc/gccbuiltins_*.di + ninja -C build-cross install - cp -R build-cross-libs/lib install/ - cp build-cross/lib/{libldc_rt.*,libLTO.dylib,LLVMgold-ldc.so} install/lib/ || true + # install the cross-compiled libs to populate: + # * lib/: runtime library artifacts + # * etc/ldc2.conf + ninja -C build-cross-libs install - mkdir install/etc - cp build-cross/bin/ldc2_install.conf install/etc/ldc2.conf - cp -R ldc/packaging/bash_completion.d install/etc/ - - # use imports from installed bootstrap compiler - ninja -C bootstrap-ldc install >/dev/null - mv bootstrap-install/import install/ + # copy gccbuiltins from bootstrap compiler + cp bootstrap-ldc/import/ldc/gccbuiltins_*.di install/import/ldc/ fi cp ldc/LICENSE install/ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21e5a3dfa23..ea649f5396b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -268,11 +268,6 @@ jobs: arch: x86_64 - name: Build bootstrap LDC uses: ./.github/actions/2-build-bootstrap - with: - # prepare for installing the bootstrap compiler to ../bootstrap-install/ - cmake_flags: >- - -DCMAKE_INSTALL_PREFIX="$PWD/../bootstrap-install" - -DINCLUDE_INSTALL_DIR="$PWD/../bootstrap-install/import" - name: Build LDC with PGO instrumentation & gather profile from compiling default libs if: matrix.with_pgo uses: ./.github/actions/2a-build-pgo diff --git a/CMakeLists.txt b/CMakeLists.txt index 437b5d3106d..12e6b92c894 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,8 @@ endif() set(D_VERSION ${DMDFE_MAJOR_VERSION} CACHE STRING "D language version") set(PROGRAM_PREFIX "" CACHE STRING "Prepended to ldc/ldmd binary names") set(PROGRAM_SUFFIX "" CACHE STRING "Appended to ldc/ldmd binary names") -set(CONF_INST_DIR ${SYSCONF_INSTALL_DIR} CACHE PATH "Directory ldc.conf is installed to") +set(CONF_INST_DIR ${SYSCONF_INSTALL_DIR} CACHE PATH "Directory ldc2.conf is installed to") +set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/d CACHE PATH "Path to install D modules to") # Note: LIB_SUFFIX should perhaps be renamed to LDC_LIBDIR_SUFFIX. set(LIB_SUFFIX "" CACHE STRING "Appended to the library installation directory. Set to '64' to install libraries into ${PREFIX}/lib64.") @@ -720,7 +721,7 @@ if(MSVC_IDE) # the IDE generator is a multi-config one # so copy the config file into the correct bin subfolder # (different outputs no longer feasible for custom commands, so disabled) - # add_custom_command(TARGET ${LDC_EXE} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}.conf $ COMMENT "Copy config file ${LDC_EXE}.conf") + # add_custom_command(TARGET ${LDC_EXE} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/etc/${LDC_EXE}.conf $ COMMENT "Copy config file ${LDC_EXE}.conf") endif() @@ -910,6 +911,42 @@ endif() # add_subdirectory(utils) +# auto-generate ldc/gccbuiltins_*.di headers, depending on LLVM version and enabled LLVM backends +set(GCCBUILTINS "") +if(TARGET gen_gccbuiltins) + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/import/ldc") + + function(gen_gccbuiltins name) + set(module "${PROJECT_BINARY_DIR}/import/ldc/gccbuiltins_${name}.di") + if (GCCBUILTINS STREQUAL "") + set(GCCBUILTINS "${module}" PARENT_SCOPE) + else() + set(GCCBUILTINS "${GCCBUILTINS};${module}" PARENT_SCOPE) + endif() + add_custom_command( + OUTPUT ${module} + COMMAND gen_gccbuiltins ${module} "${name}" + DEPENDS gen_gccbuiltins + ) + endfunction() + + set(target_arch "AArch64;AMDGPU;ARM;Mips;RISCV;NVPTX;PowerPC;SystemZ;X86") + set(target_name "aarch64;amdgcn;arm;mips;riscv;nvvm;ppc;s390;x86") + + foreach(target ${LLVM_TARGETS_TO_BUILD}) + list(FIND target_arch ${target} idx) + if(idx GREATER -1) + list(GET target_name ${idx} name) + gen_gccbuiltins(${name}) + endif() + endforeach() + + add_custom_target(gccbuiltins DEPENDS ${GCCBUILTINS}) + + # make sure they are generated when building the compiler (as link-time dependency) + add_dependencies(${LDC_EXE} gccbuiltins) +endif() + # # Auxiliary tools. # @@ -939,11 +976,18 @@ add_test(NAME build-ldc2-unittest COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BIN add_test(NAME ldc2-unittest COMMAND ${LDC_UNITTEST_EXE_FULL} --version) set_tests_properties(ldc2-unittest PROPERTIES DEPENDS build-ldc2-unittest) -if(EXISTS "${PROJECT_SOURCE_DIR}/runtime/druntime/src/object.d") +set(_LDC_BUILD_RUNTIME_DEFAULT ON) +if(CMAKE_CROSSCOMPILING) + set(_LDC_BUILD_RUNTIME_DEFAULT OFF) +endif() +option(LDC_BUILD_RUNTIME "Build the runtime libraries" ${_LDC_BUILD_RUNTIME_DEFAULT}) + +if(LDC_BUILD_RUNTIME) add_subdirectory(runtime) else() - message(STATUS "Runtime file runtime/druntime/src/object.d not found, will build ldc binaries but not the standard library.") + message(STATUS "NOT building the runtime libraries (LDC_BUILD_RUNTIME=OFF)") endif() + if(D_VERSION EQUAL 2) add_subdirectory(tests/dmd) endif() @@ -978,7 +1022,6 @@ if(${BUILD_SHARED}) # as well, for the time being this just bloats the normal packages. install(TARGETS ${LDC_LIB} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) endif() -install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}_install.conf DESTINATION ${CONF_INST_DIR} RENAME ${LDC_EXE}.conf) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(NOT DEFINED BASH_COMPLETION_COMPLETIONSDIR) @@ -993,6 +1036,17 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") install(DIRECTORY packaging/bash_completion.d/ DESTINATION ${BASH_COMPLETION_COMPLETIONSDIR}) endif() +# imports/includes +install(FILES runtime/druntime/src/object.d runtime/druntime/src/__importc_builtins.di runtime/druntime/src/importc.h DESTINATION ${INCLUDE_INSTALL_DIR}) +foreach(p core etc ldc) + install(DIRECTORY runtime/druntime/src/${p} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") + install(DIRECTORY runtime/druntime/src/${p} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.di") +endforeach() +install(DIRECTORY runtime/phobos/std DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") +install(DIRECTORY runtime/phobos/etc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") +install(DIRECTORY runtime/jit-rt/d/ldc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") +install(FILES ${GCCBUILTINS} DESTINATION ${INCLUDE_INSTALL_DIR}/ldc) + # # Packaging # diff --git a/ldc2.conf.in b/ldc2.conf.in index 0ef4caa07a2..f3b7be13398 100644 --- a/ldc2.conf.in +++ b/ldc2.conf.in @@ -23,7 +23,7 @@ default: // default switches appended after all explicit command-line switches post-switches = [ "-I@RUNTIME_DIR@/src", - "-I@LDC_BUILD_IMPORT_DIR@", + "-I@LDC_GCCBUILTINS_IMPORT_DIR@", "-I@JITRT_DIR@/d", ]; // default directories to be searched for libraries when linking diff --git a/ldc2_phobos.conf.in b/ldc2_phobos.conf.in index f2c00634f16..3bb6e85c62b 100644 --- a/ldc2_phobos.conf.in +++ b/ldc2_phobos.conf.in @@ -23,7 +23,7 @@ default: // default switches appended after all explicit command-line switches post-switches = [ "-I@RUNTIME_DIR@/src", - "-I@LDC_BUILD_IMPORT_DIR@", + "-I@LDC_GCCBUILTINS_IMPORT_DIR@", "-I@JITRT_DIR@/d", "-I@PHOBOS2_DIR@", ]; diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 94360744042..3916440e02e 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -13,6 +13,9 @@ if(NOT LDC_EXE) if(NOT DEFINED DMDFE_MINOR_VERSION OR NOT DEFINED DMDFE_PATCH_VERSION) message(FATAL_ERROR "Please define the CMake variables DMDFE_MINOR_VERSION and DMDFE_PATCH_VERSION.") endif() + if(NOT DEFINED LDC_WITH_LLD) + message(FATAL_ERROR "Please define the CMake variable LDC_WITH_LLD.") + endif() # Helper function function(append value) @@ -32,7 +35,6 @@ endif() set(MULTILIB OFF CACHE BOOL "Build both 32/64 bit runtime libraries") set(BUILD_LTO_LIBS OFF CACHE BOOL "Also build the runtime as LLVM bitcode libraries for LTO") -set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/d CACHE PATH "Path to install D modules to") set(BUILD_SHARED_LIBS AUTO CACHE STRING "Whether to build the runtime as a shared library (ON|OFF|BOTH)") set(D_FLAGS -w;-de;-preview=dip1000;-preview=dtorfields;-preview=fieldwise CACHE STRING "Runtime D compiler flags, separated by ';'") set(D_EXTRA_FLAGS "" CACHE STRING "Runtime extra D compiler flags, separated by ';'") @@ -157,7 +159,6 @@ message(STATUS "-- - Building shared libraries (BUILD_SHARED_LIBS): ${BUILD_SHA message(STATUS "-- - Building LTO libraries (BUILD_LTO_LIBS): ${BUILD_LTO_LIBS}") message(STATUS "-- - Linking shared libraries (and test runners) with (C_SYSTEM_LIBS): ${C_SYSTEM_LIBS}") -get_directory_property(PROJECT_PARENT_DIR DIRECTORY ${PROJECT_SOURCE_DIR} PARENT_DIRECTORY) set(RUNTIME_DIR ${PROJECT_SOURCE_DIR}/druntime CACHE PATH "druntime root directory") set(PHOBOS2_DIR ${PROJECT_SOURCE_DIR}/phobos CACHE PATH "Phobos root directory") set(JITRT_DIR ${PROJECT_SOURCE_DIR}/jit-rt CACHE PATH "jit runtime root directory") @@ -299,96 +300,77 @@ endif() # LLD 8+ requires (new) `--export-dynamic` for WebAssembly (https://github.com/ldc-developers/ldc/issues/3023). set(WASM_DEFAULT_LDC_SWITCHES "${WASM_DEFAULT_LDC_SWITCHES}\n \"-L--export-dynamic\",") -# Directory filled with auto-generated import files -set(LDC_BUILD_IMPORT_DIR "${PROJECT_BINARY_DIR}/import") +# Note: normally inherited from LDC CMake parent build, and only needed for ldc2_install.conf +set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/d" CACHE PATH "Path the D modules are installed to") + +# Note: default value only works if embedded in LDC CMake parent build, but only needed for ImportC (__importc_builtins.di) and non-install ldc2.conf +set(LDC_GCCBUILTINS_IMPORT_DIR "${CMAKE_BINARY_DIR}/import" CACHE PATH "Directory filled with auto-generated ldc/gccbuiltins_*.di files") -# Only generate the config files if this CMake project is embedded in the LDC CMake project. +# Generate .conf files if(LDC_EXE) - if(PHOBOS2_DIR) - set(CONFIG_NAME ${LDC_EXE}_phobos) - else() - set(CONFIG_NAME ${LDC_EXE}) - endif() - set(conf_path ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf) - set(install_conf_path ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}_install.conf) - configure_file(${PROJECT_PARENT_DIR}/${CONFIG_NAME}.conf.in ${conf_path} @ONLY) - configure_file(${PROJECT_PARENT_DIR}/${LDC_EXE}_install.conf.in ${install_conf_path} @ONLY) - - # macOS has fat libraries; otherwise, append a separate config file section for the - # multilib target and override the lib directory. - if(MULTILIB AND NOT "${TARGET_SYSTEM}" MATCHES "APPLE") - # Rename the just configured host-only *.conf files to *.conf.in during CMake invocation. - file(RENAME ${conf_path} ${conf_path}.in) - file(RENAME ${install_conf_path} ${install_conf_path}.in) - - set(MULTILIB_DIR "${CMAKE_BINARY_DIR}/lib${MULTILIB_SUFFIX}") - set(MULTILIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${MULTILIB_SUFFIX}") - - # The helper script determines the multilib triple by parsing the - # `ldc2 -m32 -v` output. This means we depend on a built ldc2 - # executable; sadly, we cannot add post-build commands to that - # top-level target directly, so use a custom target (built as part - # of `all`) to finalize the 2 config files. - add_custom_command(OUTPUT ${conf_path} VERBATIM - COMMAND ${PROJECT_PARENT_DIR}/tools/add-multilib-section.sh - ${LDC_EXE_FULL} - ${MULTILIB_SUFFIX} - ${MULTILIB_DIR} - "$<$:${MULTILIB_DIR}>" - ${conf_path}.in - ${conf_path} - DEPENDS ${LDC_EXE_FULL} - ) - add_custom_command(OUTPUT ${install_conf_path} VERBATIM - COMMAND ${PROJECT_PARENT_DIR}/tools/add-multilib-section.sh - ${LDC_EXE_FULL} - ${MULTILIB_SUFFIX} - ${MULTILIB_INSTALL_DIR} - "$<$:${MULTILIB_INSTALL_DIR}>" - ${install_conf_path}.in - ${install_conf_path} - DEPENDS ${LDC_EXE_FULL} - ) - add_custom_target(add-multilib-section ALL - DEPENDS ${conf_path} ${install_conf_path} - ) - endif() + set(CONFIG_BASE ${LDC_EXE}) +else() # not included from LDC parent build + set(CONFIG_BASE ldc2) +endif() +if(PHOBOS2_DIR) + set(CONFIG_NAME ${CONFIG_BASE}_phobos) +else() + set(CONFIG_NAME ${CONFIG_BASE}) +endif() +set(conf_path ${CMAKE_BINARY_DIR}/etc/${CONFIG_BASE}.conf) +set(install_conf_path ${CMAKE_BINARY_DIR}/etc/${CONFIG_BASE}_install.conf) +configure_file(${PROJECT_SOURCE_DIR}/../${CONFIG_NAME}.conf.in ${conf_path} @ONLY) +configure_file(${PROJECT_SOURCE_DIR}/../${CONFIG_BASE}_install.conf.in ${install_conf_path} @ONLY) + +# macOS has fat libraries; otherwise, append a separate config file section for the +# multilib target and override the lib directory. +if(MULTILIB AND NOT "${TARGET_SYSTEM}" MATCHES "APPLE") + # Rename the just configured host-only *.conf files to *.conf.in during CMake invocation. + file(RENAME ${conf_path} ${conf_path}.in) + file(RENAME ${install_conf_path} ${install_conf_path}.in) + + set(MULTILIB_DIR "${CMAKE_BINARY_DIR}/lib${MULTILIB_SUFFIX}") + set(MULTILIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${MULTILIB_SUFFIX}") + + # The helper script determines the multilib triple by parsing the + # `ldc2 -m32 -v` output. This means we depend on a built ldc2 + # executable; sadly, we cannot add post-build commands to that + # top-level target directly, so use a custom target (built as part + # of `all`) to finalize the 2 config files. + add_custom_command(OUTPUT ${conf_path} VERBATIM + COMMAND ${PROJECT_SOURCE_DIR}/../tools/add-multilib-section.sh + ${LDC_EXE_FULL} + ${MULTILIB_SUFFIX} + ${MULTILIB_DIR} + "$<$:${MULTILIB_DIR}>" + ${conf_path}.in + ${conf_path} + DEPENDS ${LDC_EXE_FULL} + ) + add_custom_command(OUTPUT ${install_conf_path} VERBATIM + COMMAND ${PROJECT_SOURCE_DIR}/../tools/add-multilib-section.sh + ${LDC_EXE_FULL} + ${MULTILIB_SUFFIX} + ${MULTILIB_INSTALL_DIR} + "$<$:${MULTILIB_INSTALL_DIR}>" + ${install_conf_path}.in + ${install_conf_path} + DEPENDS ${LDC_EXE_FULL} + ) + add_custom_target(add-multilib-section ALL + DEPENDS ${conf_path} ${install_conf_path} + ) endif() +if(NOT DEFINED CONF_INST_DIR) # set by parent LDC build + set(CONF_INST_DIR "${CMAKE_INSTALL_PREFIX}/etc") +endif() +install(FILES ${install_conf_path} DESTINATION ${CONF_INST_DIR} RENAME ${CONFIG_BASE}.conf) + # # druntime/Phobos compilation helpers. # -set(GCCBUILTINS "") -if(TARGET gen_gccbuiltins) - file(MAKE_DIRECTORY "${LDC_BUILD_IMPORT_DIR}/ldc") - - function(gen_gccbuiltins name) - set(module "${LDC_BUILD_IMPORT_DIR}/ldc/gccbuiltins_${name}.di") - if (GCCBUILTINS STREQUAL "") - set(GCCBUILTINS "${module}" PARENT_SCOPE) - else() - set(GCCBUILTINS "${GCCBUILTINS};${module}" PARENT_SCOPE) - endif() - add_custom_command( - OUTPUT ${module} - COMMAND gen_gccbuiltins ${module} "${name}" - DEPENDS gen_gccbuiltins - ) - endfunction() - - set(target_arch "AArch64;AMDGPU;ARM;Mips;RISCV;NVPTX;PowerPC;SystemZ;X86") - set(target_name "aarch64;amdgcn;arm;mips;riscv;nvvm;ppc;s390;x86") - - foreach(target ${LLVM_TARGETS_TO_BUILD}) - list(FIND target_arch ${target} idx) - if(idx GREATER -1) - list(GET target_name ${idx} name) - gen_gccbuiltins(${name}) - endif() - endforeach() -endif() - # Always build zlib and other C parts of the runtime in release mode, regardless # of what the user chose for LDC itself. Also add other C_FLAGS here. # 1) Set up CMAKE_C_FLAGS_RELEASE @@ -439,7 +421,7 @@ macro(dc src_files src_basedir d_flags output_basedir emit_bc all_at_once single # dc_deps can only contain paths, otherwise cmake will ignore the dependency. # See: https://github.com/ldc-developers/ldc/pull/4743#issuecomment-2323156173 - set(dc_deps ${LDC_EXE_FULL} ${GCCBUILTINS}) + set(dc_deps ${LDC_EXE_FULL}) if(TARGET add-multilib-section) # Make sure the config files are available before invoking LDC. set(dc_deps ${dc_deps} add-multilib-section) @@ -554,7 +536,7 @@ macro(compile_druntime d_flags lib_suffix path_suffix emit_bc all_at_once single endif() dc("${DRUNTIME_D}" "${RUNTIME_DIR}/src" - "-conf=;${d_flags};${DRUNTIME_EXTRA_FLAGS};-I${RUNTIME_DIR}/src;-I${LDC_BUILD_IMPORT_DIR}" + "-conf=;${d_flags};${DRUNTIME_EXTRA_FLAGS};-I${RUNTIME_DIR}/src" "${PROJECT_BINARY_DIR}/objects${target_suffix}" "${emit_bc}" "${all_at_once}" @@ -890,19 +872,6 @@ foreach(libname ${libs_to_install}) endif() endforeach() -set(DRUNTIME_PACKAGES core etc ldc) - -install(FILES ${RUNTIME_DIR}/src/object.d ${RUNTIME_DIR}/src/__importc_builtins.di ${RUNTIME_DIR}/src/importc.h DESTINATION ${INCLUDE_INSTALL_DIR}) -foreach(p ${DRUNTIME_PACKAGES}) - install(DIRECTORY ${RUNTIME_DIR}/src/${p} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") - install(DIRECTORY ${RUNTIME_DIR}/src/${p} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.di") -endforeach() -if(PHOBOS2_DIR) - install(DIRECTORY ${PHOBOS2_DIR}/std DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") - install(DIRECTORY ${PHOBOS2_DIR}/etc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") -endif() -install(FILES ${GCCBUILTINS} DESTINATION ${INCLUDE_INSTALL_DIR}/ldc) - # # Test targets. diff --git a/runtime/jit-rt/DefineBuildJitRT.cmake b/runtime/jit-rt/DefineBuildJitRT.cmake index 5342937fd67..585ac555064 100644 --- a/runtime/jit-rt/DefineBuildJitRT.cmake +++ b/runtime/jit-rt/DefineBuildJitRT.cmake @@ -89,9 +89,6 @@ if(LDC_DYNAMIC_COMPILE) list(APPEND ${outlist_targets} "ldc-jit-rt${target_suffix}") set(${outlist_targets} ${${outlist_targets}} PARENT_SCOPE) endfunction() - - # Install D interface files - install(DIRECTORY ${JITRT_DIR}/d/ldc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") else() function(build_jit_runtime d_flags c_flags ld_flags path_suffix outlist_targets) endfunction() diff --git a/runtime/ldc-build-runtime.d.in b/runtime/ldc-build-runtime.d.in index fe7d3a47d69..760a77f9c1f 100644 --- a/runtime/ldc-build-runtime.d.in +++ b/runtime/ldc-build-runtime.d.in @@ -158,6 +158,8 @@ void runCMake() { "-DLDMD_EXE_FULL=" ~ ldmdExecutable, "-DDMDFE_MINOR_VERSION=@DMDFE_MINOR_VERSION@", "-DDMDFE_PATCH_VERSION=@DMDFE_PATCH_VERSION@", + "-DLDC_WITH_LLD=@LDC_WITH_LLD@", + "-DINCLUDE_INSTALL_DIR=@INCLUDE_INSTALL_DIR@", ]; if (config.targetSystem.length) args ~= "-DTARGET_SYSTEM=" ~ config.targetSystem.join(";"); diff --git a/tests/dmd/CMakeLists.txt b/tests/dmd/CMakeLists.txt index 6c1b1100cb2..1a4dd5caade 100644 --- a/tests/dmd/CMakeLists.txt +++ b/tests/dmd/CMakeLists.txt @@ -47,7 +47,7 @@ function(add_testsuite config_suffix required_flags gdbflags model make_rule) add_test(NAME clean-${name} COMMAND ${CMAKE_COMMAND} -E remove_directory ${outdir}) - set(dflags "-conf=${PROJECT_BINARY_DIR}/bin/${LDC_EXE}.conf") + set(dflags "-conf=${PROJECT_BINARY_DIR}/etc/${LDC_EXE}.conf") add_test(NAME ${name} COMMAND ${RUN_DMD_TESTSUITE_EXE_FULL} RESULTS_DIR=${resultsdir} REQUIRED_ARGS=${required_flags} DFLAGS=${dflags}