Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged build system patches by Jonathan Mercier.

In detail, this commit:
 - Changes the default version that is built to D2, use D_VERSION to override.
 - Reverts back to building static libs by default until we are certain shared libs work fine everywhere.
 - Fixes installation pathes so that CMAKE_INSTALL_PREFIX is respected; /etc as sysconf dir for /usr prefix is special-cased.
 - Fixes out-of-source builds again, and causes temporary files (idgen, …) not to be written to the source directory anymore.

This is a slightly cleaned up version of the changes from #12.
  • Loading branch information...
commit 470323233a59792d7dea8a21c8a42be1f59a1806 1 parent 5e18625
David Nadlinger klickverbot authored
Showing with 105 additions and 64 deletions.
  1. +56 −31 CMakeLists.txt
  2. +2 −2 ldc.rebuild.conf.in
  3. +47 −31 runtime/CMakeLists.txt
87 CMakeLists.txt
View
@@ -61,15 +61,26 @@ execute_process(
####################
# LDC
####################
-set(D_VERSION "1" CACHE STRING "D language version")
-set(PROGRAM_PREFIX "" CACHE STRING "prepended to ldc binary name")
-set(PROGRAM_SUFFIX "" CACHE STRING "appended to ldc binary name")
-set(LIB_SUFFIX "" CACHE STRING "Suffix to add add for lib directory e.g: 64 => lib64")
-set(SYSCONF_INSTALL_DIR "/etc" CACHE STRING "Default path where configuration file go for install")
-set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Set prefix for installation")
-set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "Directory where lib will be installed")
-set(CONF_INST_DIR "${CMAKE_INSTALL_PREFIX}/${SYSCONF_INSTALL_DIR}" CACHE PATH "Set ldc.conf directory for installation")
-set(BUILD_SHARED_LIBS ON CACHE BOOL "Build dynamic Lib for druntime and phobos/tango")
+
+# Generally, we want to install everything into CMAKE_INSTALL_PREFIX, but when
+# it is /usr, put the config files into /etc to meet common practice.
+if (NOT DEFINED SYSCONF_INSTALL_DIR)
+ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+ set(SYSCONF_INSTALL_DIR "/etc")
+ else(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+ set(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc")
+ endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+endif (NOT DEFINED SYSCONF_INSTALL_DIR)
+
+set(D_VERSION 2 CACHE STRING "D language version")
+set(PROGRAM_PREFIX "" CACHE STRING "prepended to ldc binary name")
+set(PROGRAM_SUFFIX "" CACHE STRING "appended to ldc binary name")
+set(LIB_SUFFIX "" CACHE STRING "take empty string or 64. Directory where lib will be installed: lib or lib64")
+set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "Directory where lib will be installed")
+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 OFF CACHE BOOL "Build as shared library or as static library")
option(USE_BOEHM_GC "use the Boehm garbage collector internally")
option(GENERATE_OFFTI "generate complete ClassInfo.offTi arrays")
option(USE_METADATA "use metadata and related custom optimization passes")
@@ -78,20 +89,22 @@ if(D_VERSION EQUAL 1)
set(DMDFE_PATH dmd)
set(LDC_EXE ldc)
set(LDMD_EXE ldmd)
+ set(RUNTIME runtime)
add_definitions(-DDMDV1)
elseif(D_VERSION EQUAL 2)
set(DMDFE_PATH dmd2)
set(LDC_EXE ldc2)
set(LDMD_EXE ldmd2)
+ set(RUNTIME druntime)
add_definitions(-DDMDV2)
else(D_VERSION EQUAL 1)
message(FATAL_ERROR "unsupported D version")
endif(D_VERSION EQUAL 1)
file(MAKE_DIRECTORY
- ${PROJECT_SOURCE_DIR}/bin
- ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}
- ${PROJECT_SOURCE_DIR}/gen
+ ${PROJECT_BINARY_DIR}
+ ${PROJECT_BINARY_DIR}/${DMDFE_PATH}
+ ${PROJECT_BINARY_DIR}/gen
)
########## idgen and impcnvgen
@@ -106,7 +119,7 @@ add_executable(impcnvgen ${DMDFE_PATH}/impcnvgen.c)
set_target_properties(
idgen impcnvgen PROPERTIES
LINKER_LANGUAGE CXX
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}
+ RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${DMDFE_PATH}
COMPILE_FLAGS ${LLVM_CXXFLAGS}
)
get_target_property(IDGEN_LOC idgen LOCATION)
@@ -114,30 +127,30 @@ get_target_property(IMPCNVGEN_LOC impcnvgen LOCATION)
#
add_custom_command(
OUTPUT
- ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/id.c
- ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/id.h
+ ${PROJECT_BINARY_DIR}/${DMDFE_PATH}/id.c
+ ${PROJECT_BINARY_DIR}/${DMDFE_PATH}/id.h
# 2.4
COMMAND ${IDGEN_LOC}
#COMMAND idgen
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${DMDFE_PATH}
DEPENDS idgen
)
add_custom_command(
- OUTPUT ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/impcnvtab.c
+ OUTPUT ${PROJECT_BINARY_DIR}/${DMDFE_PATH}/impcnvtab.c
# 2.4
COMMAND ${IMPCNVGEN_LOC}
#COMMAND impcnvgen
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${DMDFE_PATH}
DEPENDS impcnvgen
)
set(LDC_GENERATED
- ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/id.c
- ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/id.h
- ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/impcnvtab.c
+ ${PROJECT_BINARY_DIR}/${DMDFE_PATH}/id.c
+ ${PROJECT_BINARY_DIR}/${DMDFE_PATH}/id.h
+ ${PROJECT_BINARY_DIR}/${DMDFE_PATH}/impcnvtab.c
)
########## idgen and impcnvgen done
-include_directories(. ${DMDFE_PATH} ${DMDFE_PATH}/root ${PROJECT_SOURCE_DIR}/${DMDFE_PATH} ${PROJECT_SOURCE_DIR} ${LLVM_INCLUDEDIR})
+include_directories(. ${DMDFE_PATH} ${DMDFE_PATH}/root ${PROJECT_BINARY_DIR}/${DMDFE_PATH} ${PROJECT_SOURCE_DIR} ${LLVM_INCLUDEDIR})
set(EXTRA_LLVM_MODULES "" CACHE STRING "extra llvm components to link in (see llvm-config --components)")
separate_arguments(EXTRA_LLVM_MODULES)
@@ -243,8 +256,7 @@ if(USE_METADATA)
endif(USE_METADATA)
if(CMAKE_MINOR_VERSION LESS 6)
- set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin CACHE PATH "output dir for built executables")
- set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib CACHE PATH "output dir for built libraries")
+ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "output dir for built executables")
add_definitions(-DDEFAULT_TARGET_TRIPLE=\\"${DEFAULT_TARGET}\\")
add_definitions(-DDEFAULT_ALT_TARGET_TRIPLE=\\"${DEFAULT_ALT_TARGET}\\")
add_definitions(-DLDC_INSTALL_PREFIX=\\"${CMAKE_INSTALL_PREFIX}\\")
@@ -264,7 +276,7 @@ set(LDC_EXE_NAME ${PROGRAM_PREFIX}${LDC_EXE}${PROGRAM_SUFFIX})
set_target_properties(
${LDC_EXE} PROPERTIES
OUTPUT_NAME ${LDC_EXE_NAME}
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin
+ RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
COMPILE_FLAGS "${LLVM_CXXFLAGS} ${LIBCONFIG_CXXFLAGS} -Wno-deprecated -Wno-write-strings -fexceptions"
)
@@ -272,6 +284,8 @@ set_target_properties(
target_link_libraries(${LDC_EXE} "${LLVM_LDFLAGS} ${LLVM_LIBS}" ${LIBCONFIG_LDFLAGS} config++)
if(WIN32)
target_link_libraries(${LDC_EXE} imagehlp psapi)
+elseif(UNIX)
+ target_link_libraries(${LDC_EXE} dl)
endif(WIN32)
if(USE_BOEHM_GC)
@@ -281,11 +295,22 @@ endif(USE_BOEHM_GC)
get_target_property(LDC_LOC ${LDC_EXE} LOCATION)
# TODO: testrun
-FILE(GLOB library "${PROJECT_SOURCE_DIR}/lib/*.a" "${PROJECT_SOURCE_DIR}/lib/*.so" "${PROJECT_SOURCE_DIR}/lib/*.dll")
-install(TARGETS ${LDC_EXE} DESTINATION bin)
-install(PROGRAMS ${PROJECT_SOURCE_DIR}/bin/${LDMD_EXE} DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/bin/${LDC_EXE}_install.conf DESTINATION ${CONF_INST_DIR}/${LDC_EXE}conf)
-install(FILES ${PROJECT_SOURCE_DIR}/bin/${LDC_EXE}.rebuild.conf DESTINATION ${CONF_INST_DIR})
-install(FILES ${library} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS ${LDC_EXE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+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(D_VERSION EQUAL 2)
+ install(DIRECTORY ${PROJECT_BINARY_DIR}/runtime/import/core DESTINATION ${INCLUDE_INSTALL_DIR}/)
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/phobos DESTINATION ${INCLUDE_INSTALL_DIR}/ PATTERN ".git" EXCLUDE )
+ install(DIRECTORY ${LIBRARY_OUTPUT_PATH} DESTINATION ${CMAKE_INSTALL_PREFIX} USE_SOURCE_PERMISSIONS)
+ install(FILES ${PROJECT_SOURCE_DIR}/${RUNTIME}/import/object.di DESTINATION ${INCLUDE_INSTALL_DIR}/ldc)
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/${RUNTIME}/import/ldc DESTINATION ${INCLUDE_INSTALL_DIR}/)
+else(D_VERSION EQUAL 2)
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/${RUNTIME}/internal/ldc/ DESTINATION ${INCLUDE_INSTALL_DIR}/ldc/)
+endif(D_VERSION EQUAL 2)
+install(DIRECTORY ${PROJECT_SOURCE_DIR}/runtime/import/ldc DESTINATION ${INCLUDE_INSTALL_DIR}/)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ install(DIRECTORY bash_completion.d DESTINATION ${CONF_INST_DIR})
+endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_subdirectory(runtime EXCLUDE_FROM_ALL)
4 ldc.rebuild.conf.in
View
@@ -1,2 +1,2 @@
-[Environment]
-DFLAGS=-I@RUNTIME_DIR@ -I@RUNTIME_DIR@/lib/common -L-L%@P%/../lib -d-version=Tango -defaultlib=@RUNTIME_AIO@ -debuglib=@RUNTIME_AIO@
+[Environment]
+DFLAGS=-I@RUNTIME_DIR@ -I@RUNTIME_DIR@/lib/common -L-L@CMAKE_INSTALL_LIBDIR@ -d-version=Tango -defaultlib=@RUNTIME_AIO@ -debuglib=@RUNTIME_AIO@
78 runtime/CMakeLists.txt
View
@@ -31,9 +31,9 @@ if(D_VERSION EQUAL 1)
set(LDC_IMPORTS)
macro(imports_file SRCARG)
get_filename_component(DEST ${SRCARG} NAME)
- set(SRC ${PROJECT_SOURCE_DIR}/${SRCARG})
+ set(SRC ${PROJECT_PARENT_DIR}/${SRCARG})
set(DEST ${RUNTIME_DIR}/ldc/${DEST})
-
+
list(APPEND LDC_IMPORTS ${DEST})
add_custom_command(
OUTPUT ${DEST}
@@ -52,7 +52,7 @@ if(D_VERSION EQUAL 1)
set(RUNTIME_DC ldc-runtime)
set(RUNTIME_AIO tango)
# set paths to source files, or fill lists directly
- set(RUNTIME_DC_DIR ${PROJECT_SOURCE_DIR}/internal)
+ set(RUNTIME_DC_DIR ${RUNTIME_DIR}/internal)
set(RUNTIME_GC_DIR ${RUNTIME_DIR}/lib/gc/basic)
set(RUNTIME_INCLUDE ${RUNTIME_DC_DIR})
file(GLOB CORE_D ${RUNTIME_DIR}/lib/common/tango/core/*.d)
@@ -76,6 +76,9 @@ elseif(D_VERSION EQUAL 2)
file(GLOB_RECURSE GC_D ${RUNTIME_GC_DIR}/*.d)
file(GLOB_RECURSE DCRT_D ${RUNTIME_DC_DIR}/*.d)
file(GLOB_RECURSE LDC_D ${RUNTIME_DIR}/src/ldc/*.d)
+ list(REMOVE_ITEM CORE_D
+ ${RUNTIME_DIR}/src/core/bitop.d
+ )
list(REMOVE_ITEM DCRT_D
${RUNTIME_DC_DIR}/alloca.d
${RUNTIME_DC_DIR}/arraybyte.d
@@ -102,7 +105,7 @@ elseif(D_VERSION EQUAL 2)
file(GLOB_RECURSE CORE_D_SYS ${RUNTIME_DIR}/src/core/sys/osx/*.d)
endif(UNIX)
list(APPEND CORE_D ${CORE_D_SYNC} ${CORE_D_SYS} ${CORE_D_STDC} )
- set(GENERATE_DI ${CORE_D})
+ list(APPEND GENERATE_DI ${CORE_D})
list(APPEND CORE_D ${LDC_D} ${RUNTIME_DIR}/src/object_.d)
file(GLOB CORE_C ${RUNTIME_DIR}/src/core/stdc/*.c)
@@ -153,15 +156,17 @@ if(NOT LDC_LOC)
endif(D_VERSION EQUAL 1)
endif(NOT LDC_EXE)
- find_program(LDC_LOC ${LDC_EXE} ../bin DOC "path to ldc binary")
+ find_program(LDC_LOC ${LDC_EXE} ${PROJECT_BINARY_DIR}/../bin DOC "path to ldc binary")
if(NOT LDC_LOC)
message(SEND_ERROR "ldc not found")
endif(NOT LDC_LOC)
set(LDC_EXE_NAME ${LDC_EXE})
endif(NOT LDC_LOC)
-configure_file(${PROJECT_PARENT_DIR}/${CONFIG_NAME}.conf.in ${PROJECT_SOURCE_DIR}/../bin/${LDC_EXE}.conf)
-configure_file(${PROJECT_PARENT_DIR}/${LDC_EXE}.rebuild.conf.in ${PROJECT_SOURCE_DIR}/../bin/${LDC_EXE}.rebuild.conf)
+configure_file(${PROJECT_PARENT_DIR}/${CONFIG_NAME}.conf.in ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf)
+# Prepare the config files for installation in bin.
+configure_file(${PROJECT_PARENT_DIR}/${LDC_EXE}_install.conf.in ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}_install.conf)
+configure_file(${PROJECT_PARENT_DIR}/${LDC_EXE}.rebuild.conf.in ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}_install.rebuild.conf)
# patch runtime source, uses LDC_EXE for ldc2
if(D_VERSION EQUAL 2)
@@ -177,7 +182,7 @@ if(D_VERSION EQUAL 2)
# rebuild cache to include sources added by patch
add_custom_command(
OUTPUT recache
- COMMAND ${CMAKE_COMMAND} -H${PROJECT_PARENT_DIR} -B${PROJECT_SOURCE_DIR}/..
+ COMMAND ${CMAKE_COMMAND} -H${PROJECT_PARENT_DIR} -B${PROJECT_BINARY_DIR}/..
)
add_custom_target(patch DEPENDS patch-runtime recache ${LDC_IMPORTS})
endif(NOT PATCH_EXE)
@@ -196,8 +201,8 @@ macro(dc INPUT_D OUTLIST_O OUTLIST_BC INCDIR MOREFLAGS PATH)
else ("${path}" STREQUAL "")
set(output ${path}/${name})
endif ("${path}" STREQUAL "")
- set(OUTPUT_O ${PROJECT_SOURCE_DIR}/${output}.o)
- set(OUTPUT_BC ${PROJECT_SOURCE_DIR}/${output}.bc)
+ set(OUTPUT_O ${PROJECT_BINARY_DIR}/${output}.o)
+ set(OUTPUT_BC ${PROJECT_BINARY_DIR}/${output}.bc)
list(APPEND ${OUTLIST_O} ${OUTPUT_O})
list(APPEND ${OUTLIST_BC} ${OUTPUT_BC})
@@ -205,8 +210,9 @@ macro(dc INPUT_D OUTLIST_O OUTLIST_BC INCDIR MOREFLAGS PATH)
if (INDEX EQUAL -1)
set(DI_CMD "")
else (INDEX EQUAL -1)
+ string(REGEX REPLACE "src/ldc" "src/core" output ${output})
string(REGEX REPLACE "^src/" "" di_output ${output})
- set(DI_CMD -Hf=${CMAKE_BINARY_DIR}/import/${di_output}.di)
+ set(DI_CMD -Hf=${PROJECT_BINARY_DIR}/import/${di_output}.di)
list(REMOVE_AT GENERATE_DI ${INDEX})
endif (INDEX EQUAL -1)
@@ -215,11 +221,12 @@ macro(dc INPUT_D OUTLIST_O OUTLIST_BC INCDIR MOREFLAGS PATH)
OUTPUT
${OUTPUT_O}
${OUTPUT_BC}
- COMMAND ${LDC_LOC} --output-o --output-bc -c -I${INCDIR} -I${RUNTIME_GC_DIR} ${INPUT_D} -of${OUTPUT_O} ${DI_CMD} ${D_FLAGS} ${MOREFLAGS}
+ COMMAND ${LDC_LOC} --output-o --output-bc -c -I${INCDIR} -I${RUNTIME_GC_DIR} ${INPUT_D} -of${OUTPUT_O} ${DI_CMD} ${D_FLAGS} ${MOREFLAGS}
+ WORKING_DIRECTORY ${PROJECT_PARENT_DIR}
DEPENDS ${LDC_LOC}
${INPUT_D}
${LDC_IMPORTS}
- ${PROJECT_SOURCE_DIR}/../bin/${LDC_EXE}.conf
+ ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf
)
endmacro(dc)
@@ -239,19 +246,21 @@ foreach(f ${DCRT_D})
endif(D_VERSION EQUAL 1)
endforeach(f)
-if(BUILD_SINGLE_LIB)
- add_library(${RUNTIME_AIO} ${D_LIBRARY_TYPE} ${CORE_O} ${CORE_C} ${GC_O} ${DCRT_O} ${DCRT_C})
- set(LIBS ${RUNTIME_AIO})
-else(BUILD_SINGLE_LIB)
- add_library(${RUNTIME_CC} ${D_LIBRARY_TYPE} ${CORE_O} ${CORE_C})
- add_library(${RUNTIME_GC} ${D_LIBRARY_TYPE} ${GC_O})
- add_library(${RUNTIME_DC} ${D_LIBRARY_TYPE} ${DCRT_O} ${DCRT_C})
- set(LIBS
- ${RUNTIME_CC}
- ${RUNTIME_GC}
- ${RUNTIME_DC}
- )
-endif(BUILD_SINGLE_LIB)
+if(EXISTS ${PROJECT_PARENT_DIR}/${RUNTIME})
+ if(BUILD_SINGLE_LIB)
+ add_library(${RUNTIME_AIO} ${D_LIBRARY_TYPE} ${CORE_O} ${CORE_C} ${GC_O} ${DCRT_O} ${DCRT_C})
+ set(LIBS ${RUNTIME_AIO})
+ else(BUILD_SINGLE_LIB)
+ add_library(${RUNTIME_CC} ${D_LIBRARY_TYPE} ${CORE_O} ${CORE_C})
+ add_library(${RUNTIME_GC} ${D_LIBRARY_TYPE} ${GC_O})
+ add_library(${RUNTIME_DC} ${D_LIBRARY_TYPE} ${DCRT_O} ${DCRT_C})
+ set(LIBS
+ ${RUNTIME_CC}
+ ${RUNTIME_GC}
+ ${RUNTIME_DC}
+ )
+ endif(BUILD_SINGLE_LIB)
+endif(EXISTS ${PROJECT_PARENT_DIR}/${RUNTIME})
if(BUILD_BC_LIBS)
find_program(LLVM_AR_EXE llvm-ar ${LLVM_INSTDIR}/bin DOC "path to llvm-ar tool")
@@ -271,7 +280,7 @@ if(BUILD_BC_LIBS)
COMMAND ${LLVM_AR_EXE} rs lib${RUNTIME_GC}-bc.a ${GC_BC}
# cannot parse genobj.bc if built with -g
# COMMAND ${LLVM_AR_EXE} rs lib${RUNTIME_DC}-bc.a ${DCRT_BC}
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../lib
+ WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
DEPENDS
${CORE_BC}
${GC_BC}
@@ -281,11 +290,18 @@ if(BUILD_BC_LIBS)
set(BCLIBS bclibs)
endif(BUILD_BC_LIBS)
+if(D_VERSION EQUAL 2)
+ if(NOT PROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}")
+ file(COPY ${PROJECT_PARENT_DIR}/${RUNTIME} DESTINATION ${PROJECT_BINARY_DIR}/../)
+ file(COPY ${PROJECT_PARENT_DIR}/phobos DESTINATION ${PROJECT_BINARY_DIR}/../)
+ endif(NOT PROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}")
+endif(D_VERSION EQUAL 2)
+
set_target_properties(
${LIBS} PROPERTIES
LINKER_LANGUAGE C
- ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../lib
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../lib
+ ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
+ LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
)
# BCLIBS is empty if BUILD_BC_LIBS is not selected
@@ -309,8 +325,8 @@ if(PHOBOS2_DIR)
set_target_properties(
lphobos2 PROPERTIES
LINKER_LANGUAGE C
- ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../lib
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../lib
+ ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
+ LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
)
add_custom_target(phobos2 DEPENDS lphobos2)
endif(PHOBOS2_DIR)
Please sign in to comment.
Something went wrong with that request. Please try again.