Skip to content

Commit

Permalink
Fixed ldc-developers#17 and ldc-developers#23 — added 'MULTILIB' opti…
Browse files Browse the repository at this point in the history
…on to cmake script and fixed 'make install'
  • Loading branch information
AlexeyProkhin committed Dec 2, 2011
1 parent 250d8ed commit 7d74a80
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 120 deletions.
19 changes: 2 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ 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")
Expand Down Expand Up @@ -295,23 +290,13 @@ endif(USE_BOEHM_GC)

get_target_property(LDC_LOC ${LDC_EXE} LOCATION)

# TODO: testrun
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)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/runtime/import/ldc DESTINATION ${INCLUDE_INSTALL_DIR})
endif(D_VERSION EQUAL 2)

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)
add_subdirectory(runtime)
2 changes: 1 addition & 1 deletion ldc2.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ default:
"-I@PROJECT_BINARY_DIR@/../import",
"-I@RUNTIME_DIR@/import",
"-I@RUNTIME_DIR@/src",
"-L-L@PROJECT_BINARY_DIR@/../lib",
"-L-L@PROJECT_BINARY_DIR@/../lib", @MUTILIB_ADDITIONAL_PATH@
"-defaultlib=@RUNTIME_AIO@",
"-debuglib=@RUNTIME_AIO@"
];
Expand Down
3 changes: 1 addition & 2 deletions ldc2_install.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ default:
// 'switches' holds array of string that are appends to the command line
// arguments before they are parsed.
switches = [
"-I@INCLUDE_INSTALL_DIR@/phobos",
"-I@INCLUDE_INSTALL_DIR@/ldc",
"-I@INCLUDE_INSTALL_DIR@",
"-L-L@CMAKE_INSTALL_LIBDIR@",
"-L-L@CMAKE_INSTALL_LIBDIR@", @MUTILIB_ADDITIONAL_INSTALL_PATH@
"-defaultlib=lphobos2",
"-debuglib=lphobos2"
];
Expand Down
4 changes: 2 additions & 2 deletions ldc2_phobos.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ default:
// 'switches' holds array of string that are appends to the command line
// arguments before they are parsed.
switches = [
"-I@PROJECT_BINARY_DIR@/../import",
"-I@PROJECT_BINARY_DIR@/../import",
"-I@RUNTIME_DIR@/import",
"-I@RUNTIME_DIR@/src",
"-I@PHOBOS2_DIR@/",
"-L-L@PROJECT_BINARY_DIR@/../lib",
"-L-L@PROJECT_BINARY_DIR@/../lib", @MUTILIB_ADDITIONAL_PATH@
"-defaultlib=lphobos2",
"-debuglib=lphobos2"
];
Expand Down
Loading

0 comments on commit 7d74a80

Please sign in to comment.