Permalink
Browse files

Consistently drop conditions in else/end CMake statements.

  • Loading branch information...
klickverbot committed Dec 8, 2012
1 parent 213ae8d commit 48f476dcbe6ca03d7cdc8726aa9c83576c6cb203
Showing with 45 additions and 45 deletions.
  1. +20 −20 CMakeLists.txt
  2. +25 −25 runtime/CMakeLists.txt
View
@@ -5,7 +5,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
if(MSVC)
set(LIBCONFIG_DLL OFF CACHE BOOL "Use libconfig++ DLL instead of static library")
-endif(MSVC)
+endif()
#
# Locate LLVM.
@@ -26,13 +26,13 @@ find_package(LibConfig++ REQUIRED)
# 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(NOT DEFINED SYSCONF_INSTALL_DIR)
if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
set(SYSCONF_INSTALL_DIR "/etc")
- else(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+ else()
set(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc")
- endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
-endif (NOT DEFINED SYSCONF_INSTALL_DIR)
+ endif()
+endif()
set(D_VERSION 2 CACHE STRING "D language version")
set(PROGRAM_PREFIX "" CACHE STRING "Prepended to ldc/ldmd binary names")
@@ -57,9 +57,9 @@ elseif(D_VERSION EQUAL 2)
set(LDMD_EXE ldmd2)
set(RUNTIME druntime)
add_definitions(-DDMDV2)
-else(D_VERSION EQUAL 1)
+else()
message(FATAL_ERROR "unsupported D version")
-endif(D_VERSION EQUAL 1)
+endif()
set(LDC_EXE_NAME ${PROGRAM_PREFIX}${LDC_EXE}${PROGRAM_SUFFIX})
set(LDMD_EXE_NAME ${PROGRAM_PREFIX}${LDMD_EXE}${PROGRAM_SUFFIX})
@@ -72,7 +72,7 @@ file(MAKE_DIRECTORY
if(MSVC)
ENABLE_LANGUAGE(ASM_MASM)
-endif(MSVC)
+endif()
#
# Run idgen and impcnvgen.
@@ -163,7 +163,7 @@ if(MSVC)
# See below why this don't work
# if(CMAKE_CL_64)
# ${PROJECT_SOURCE_DIR}/vcbuild/ldfpu.asm
-# endif(CMAKE_CL_64)
+# endif()
)
if(CMAKE_CL_64)
# MASM support does not work yet!
@@ -175,7 +175,7 @@ if(MSVC)
${CMAKE_CURRENT_BINARY_DIR}/ldfpu.obj
)
endif()
-endif(MSVC)
+endif()
# disable dmd gc
list(REMOVE_ITEM FE_SRC ${PROJECT_SOURCE_DIR}/${DMDFE_PATH}/root/dmgcmem.c)
set(LDC_SOURCE_FILES
@@ -234,19 +234,19 @@ add_definitions(
if(UNIX)
add_definitions(-DPOSIX)
-endif(UNIX)
+endif()
if(USE_BOEHM_GC)
add_definitions(-DREDIRECT_MALLOC=GC_malloc -DIGNORE_FREE)
-endif(USE_BOEHM_GC)
+endif()
if(GENERATE_OFFTI)
add_definitions(-DGENERATE_OFFTI)
-endif(GENERATE_OFFTI)
+endif()
if(USE_METADATA)
add_definitions(-DUSE_METADATA)
-endif(USE_METADATA)
+endif()
if(MSVC)
set(EXTRA_CXXFLAGS "/W0 /wd4996 /GF /GR- /RTC1")
@@ -259,9 +259,9 @@ endif()
#
if(BUILD_SHARED)
set(LDC_LIB_TYPE SHARED)
-else(BUILD_SHARED)
+else()
set(LDC_LIB_TYPE STATIC)
-endif(BUILD_SHARED)
+endif()
set(LDC_LIB LDCShared)
add_library(${LDC_LIB} ${LDC_LIB_TYPE} ${LDC_SOURCE_FILES})
@@ -282,11 +282,11 @@ if(WIN32)
target_link_libraries(${LDC_LIB} imagehlp psapi)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${LDC_LIB} dl)
-endif(WIN32)
+endif()
if(USE_BOEHM_GC)
target_link_libraries(${LDC_LIB} ${PROJECT_SOURCE_DIR}/libgc.a)
-endif(USE_BOEHM_GC)
+endif()
add_executable(${LDC_EXE} ${DRV_SRC} ${DRV_HDR})
@@ -300,7 +300,7 @@ target_link_libraries(${LDC_EXE} ${LDC_LIB} ${LIBCONFIG++_LIBRARY})
if(MSVC)
# Add a post build event in Visual Studio to copy the config file into Debug/Release folder
add_custom_command(TARGET ${LDC_EXE} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}.conf $<TARGET_FILE_DIR:${LDC_EXE}> COMMENT "Copy config file ${LDC_EXE}.conf")
-endif(MSVC)
+endif()
# For use by the druntime/Phobos build system.
get_target_property(LDC_LOC ${LDC_EXE} LOCATION)
@@ -384,4 +384,4 @@ install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}_install.rebuild.conf DESTINAT
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(DIRECTORY bash_completion.d DESTINATION ${CONF_INST_DIR})
-endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+endif()
View
@@ -51,10 +51,10 @@ if(BUILD_SHARED_LIBS)
list(APPEND LD_FLAGS -Wl,-U,__Dmain)
endif()
set(D_LIBRARY_TYPE SHARED)
-else(BUILD_SHARED_LIBS)
+else()
set(D_LIBRARY_TYPE STATIC)
set(CXX_COMPILE_FLAGS " ")
-endif(BUILD_SHARED_LIBS)
+endif()
get_directory_property(PROJECT_PARENT_DIR DIRECTORY ${PROJECT_SOURCE_DIR} PARENT_DIRECTORY)
set(RUNTIME_DIR ${PROJECT_SOURCE_DIR}/druntime CACHE PATH "runtime source dir")
@@ -151,7 +151,7 @@ if(PHOBOS2_DIR)
)
if(WIN32)
file(GLOB PHOBOS2_D_WIN ${PHOBOS2_DIR}/std/windows/*.d)
- endif(WIN32)
+ endif()
list(APPEND PHOBOS2_D
${PHOBOS2_D_NET}
${PHOBOS2_D_INTERNAL}
@@ -165,22 +165,22 @@ if(PHOBOS2_DIR)
${PHOBOS2_DIR}/std/intrinsic.d
)
set(CONFIG_NAME ${LDC_EXE}_phobos)
-else(PHOBOS2_DIR)
+else()
set(CONFIG_NAME ${LDC_EXE})
-endif(PHOBOS2_DIR)
+endif()
# should only be necessary if run independently from ldc cmake project
if(NOT LDC_LOC)
if(NOT LDC_EXE)
set(LDC_EXE ldc2)
- endif(NOT LDC_EXE)
+ endif()
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)
+ endif()
set(LDC_EXE_NAME ${LDC_EXE})
-endif(NOT LDC_LOC)
+endif()
#
# Create configuration files.
@@ -189,7 +189,7 @@ endif(NOT LDC_LOC)
if(MULTILIB)
set(MULTILIB_ADDITIONAL_PATH "\n \"-L-L${CMAKE_BINARY_DIR}/lib${MULTILIB_SUFFIX}\",\n \"-L--no-warn-search-mismatch\",")
set(MULTILIB_ADDITIONAL_INSTALL_PATH "\n \"-L-L${CMAKE_INSTALL_PREFIX}/lib${MULTILIB_SUFFIX}\",\n \"-L--no-warn-search-mismatch\",")
-endif(MULTILIB)
+endif()
configure_file(${PROJECT_PARENT_DIR}/${CONFIG_NAME}.conf.in ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf)
# Prepare the config files for installation in bin.
@@ -239,7 +239,7 @@ macro(dc input_d d_flags output_dir output_suffix outlist_o outlist_bc)
${LDC_IMPORTS}
${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf
)
-endmacro(dc)
+endmacro()
# Builds a .di "header" file for a given D module. The path of the output
# file is appended to outlist_header.
@@ -264,7 +264,7 @@ macro(dc_header input_d d_flags outlist_header)
${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf
)
endif()
-endmacro(dc_header)
+endmacro()
# Builds a copy of druntime/Phobos from the source files gathered above.
@@ -275,30 +275,30 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix)
set(target_suffix "")
if(NOT "${lib_suffix}" STREQUAL "")
set(target_suffix "${lib_suffix}")
- endif(NOT "${lib_suffix}" STREQUAL "")
+ endif()
if(NOT "${path_suffix}" STREQUAL "")
set(target_suffix "${target_suffix}_${path_suffix}")
- endif(NOT "${path_suffix}" STREQUAL "")
+ endif()
set(CORE_O "")
set(CORE_BC "")
foreach(f ${CORE_D})
dc(${f} "${d_flags};-disable-invariants" "${RUNTIME_DIR}"
"${target_suffix}" CORE_O CORE_BC)
- endforeach(f)
+ endforeach()
set(GC_O "")
set(GC_BC "")
foreach(f ${GC_D})
dc(${f} "${d_flags};-disable-invariants" "${RUNTIME_DIR}"
"${target_suffix}" GC_O GC_BC)
- endforeach(f)
+ endforeach()
set(DCRT_O "")
set(DCRT_BC "")
foreach(f ${DCRT_D})
dc(${f} "${d_flags}" "${RUNTIME_DIR}" "${target_suffix}" DCRT_O DCRT_BC)
- endforeach(f)
+ endforeach()
# Always build zlib and other C parts of the runtime in release mode.
set_source_files_properties(${CORE_C} ${DCRT_C} PROPERTIES
@@ -357,7 +357,7 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix)
set(PHOBOS2_BC "")
foreach(f ${PHOBOS2_D})
dc(${f} "${d_flags};-I${PHOBOS2_DIR}" ${PHOBOS2_DIR} "${target_suffix}" PHOBOS2_O PHOBOS2_BC)
- endforeach(f)
+ endforeach()
add_library(phobos-ldc${target_suffix} ${D_LIBRARY_TYPE}
${ZLIB_C}
@@ -387,13 +387,13 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix)
endif()
install(TARGETS phobos-ldc${target_suffix} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${path_suffix})
add_dependencies(phobos2 DEPENDS phobos-ldc${target_suffix})
- endif(PHOBOS2_DIR)
+ endif()
if(BUILD_BC_LIBS)
find_program(LLVM_AR_EXE llvm-ar ${LLVM_INSTDIR}/bin DOC "path to llvm-ar tool")
if(NOT LLVM_AR_EXE)
message(SEND_ERROR "llvm-ar not found")
- endif(NOT LLVM_AR_EXE)
+ endif()
if(BUILD_SINGLE_LIB)
add_custom_command(
@@ -408,7 +408,7 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix)
${LDC_IMPORTS}
${PHOBOS2_BC}
)
- else(BUILD_SINGLE_LIB)
+ else()
add_custom_command(
OUTPUT bclibs
COMMAND ${LLVM_AR_EXE} rs lib${RUNTIME_CC}-bc.a ${CORE_BC}
@@ -423,9 +423,9 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix)
${LDC_IMPORTS}
${PHOBOS2_BC}
)
- endif(BUILD_SINGLE_LIB)
+ endif()
set(BCLIBS bclibs)
- endif(BUILD_BC_LIBS)
+ endif()
# BCLIBS is empty if BUILD_BC_LIBS is not selected
add_custom_target(runtime${target_suffix} DEPENDS ${LIBS} ${BCLIBS})
@@ -443,7 +443,7 @@ endmacro()
if(PHOBOS2_DIR)
add_custom_target(phobos2)
-endif(PHOBOS2_DIR)
+endif()
if(MSVC)
if (LINK_WITH_MSVCRT)
set(RT_CFLAGS "/MDd")
@@ -457,7 +457,7 @@ endif()
build_runtime_variants("" "${RT_CLAGS}" "${LD_FLAGS}" "${LIB_SUFFIX}")
if(MULTILIB)
build_runtime_variants("-m${MULTILIB_SUFFIX}" "-m${MULTILIB_SUFFIX} ${RT_CFLAGS}" "-m${MULTILIB_SUFFIX} ${LD_FLAGS}" "${MULTILIB_SUFFIX}")
-endif(MULTILIB)
+endif()
set(runtime_headers)
foreach(f ${CORE_D_HEADERS})
@@ -474,7 +474,7 @@ 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")
install(FILES ${PHOBOS2_DIR}/crc32.d DESTINATION ${INCLUDE_INSTALL_DIR})
-endif(PHOBOS2_DIR)
+endif()
install(FILES ${RUNTIME_DIR}/src/object.di DESTINATION ${INCLUDE_INSTALL_DIR}/ldc)
install(DIRECTORY ${RUNTIME_DIR}/src/ldc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.di")
install(DIRECTORY ${RUNTIME_DIR}/src/core DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.di")

0 comments on commit 48f476d

Please sign in to comment.