Require CMake >= 2.8.9 and update Travis' CMake

The POSITION_INDEPENDENT_CODE target property seems to be supported since
CMake 2.8.9, and Ubuntu 12.04 uses 2.8.7.
This commit is contained in:
Martin 2017-03-04 17:09:50 +01:00
parent 99acea70a0
commit 647e3b6fb2
4 changed files with 12 additions and 11 deletions

View file

@ -39,6 +39,7 @@ addons:
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- george-edison55-precise-backports # more recent CMake
packages: packages:
- libconfig++8-dev - libconfig++8-dev
- gdb - gdb
@ -51,6 +52,8 @@ addons:
- libedit2 - libedit2
- libedit-dev - libedit-dev
- libcurl3:i386 - libcurl3:i386
- cmake
- cmake-data
before_install: before_install:
- -
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then if [ "${TRAVIS_OS_NAME}" = "linux" ]; then

View file

@ -325,7 +325,7 @@ cl::opt<std::string>
#endif #endif
cl::opt<llvm::Reloc::Model> mRelocModel( cl::opt<llvm::Reloc::Model> mRelocModel(
"relocation-model", cl::desc("Relocation model"), "relocation-model", cl::desc("Relocation model"), cl::ZeroOrMore,
#if LDC_LLVM_VER < 309 #if LDC_LLVM_VER < 309
cl::init(llvm::Reloc::Default), cl::init(llvm::Reloc::Default),
#endif #endif

View file

@ -1,6 +1,6 @@
project(runtime) project(runtime)
cmake_minimum_required(VERSION 2.8.5) cmake_minimum_required(VERSION 2.8.9)
# #
# Main configuration. # Main configuration.
@ -480,7 +480,12 @@ macro(build_runtime_variants d_flags c_flags ld_flags path_suffix outlist_target
"${path_suffix}" "${path_suffix}"
${outlist_targets} ${outlist_targets}
) )
build_profile_runtime ("${d_flags}" "${c_flags}" "${ld_flags}" "${path_suffix}" ${outlist_targets})
if(LDC_WITH_PGO)
build_profile_runtime("${d_flags};${D_FLAGS};${D_FLAGS_RELEASE}" "${c_flags}" "${ld_flags}" "${path_suffix}" ${outlist_targets})
get_target_suffix("" "${path_suffix}" target_suffix)
set_common_library_properties(ldc-profile-rt${target_suffix})
endif()
endmacro() endmacro()
# Setup the build of profile-rt # Setup the build of profile-rt

View file

@ -16,8 +16,6 @@ if (LDC_WITH_PGO)
if (NOT (LDC_LLVM_VER GREATER 309)) if (NOT (LDC_LLVM_VER GREATER 309))
set(PROFRT_EXTRA_LDFLAGS "Ws2_32.lib") set(PROFRT_EXTRA_LDFLAGS "Ws2_32.lib")
endif() endif()
else()
set(PROFRT_EXTRA_FLAGS "-fPIC -O3")
endif() endif()
CHECK_CXX_SOURCE_COMPILES(" CHECK_CXX_SOURCE_COMPILES("
@ -115,9 +113,4 @@ if (LDC_WITH_PGO)
# Install D interface files to profile-rt. # Install D interface files to profile-rt.
install(DIRECTORY ${PROFILERT_DIR}/d/ldc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d") install(DIRECTORY ${PROFILERT_DIR}/d/ldc DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d")
else()
# No profiling supported, define NOP macro
macro(build_profile_runtime c_flags ld_flags path_suffix outlist_targets)
endmacro()
endif() endif()