Skip to content

Commit f325b8c

Browse files
author
Chris Bieneman
committed
[CMake] Cleaning up CMake version checks in ExternalProject calls
Now that we're on CMake 3.4.3 all the ExternalProject features we use are supported everywhere, so we don't need the version checks anymore. llvm-svn: 272324
1 parent 04e8a21 commit f325b8c

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

clang/CMakeLists.txt

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -632,19 +632,6 @@ configure_file(
632632
if (CLANG_ENABLE_BOOTSTRAP)
633633
include(ExternalProject)
634634

635-
if(CMAKE_VERSION VERSION_GREATER 3.1.0)
636-
set(cmake_3_1_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL 1)
637-
endif()
638-
639-
if(CMAKE_VERSION VERSION_GREATER 3.3.20150708)
640-
set(cmake_3_4_USES_TERMINAL_OPTIONS
641-
USES_TERMINAL_CONFIGURE 1
642-
USES_TERMINAL_BUILD 1
643-
USES_TERMINAL_INSTALL 1
644-
)
645-
set(cmake_3_4_USES_TERMINAL USES_TERMINAL 1)
646-
endif()
647-
648635
if(NOT CLANG_STAGE)
649636
set(CLANG_STAGE stage1)
650637
message(STATUS "Setting current clang stage to: ${CLANG_STAGE}")
@@ -770,7 +757,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
770757
SOURCE_DIR ${CMAKE_SOURCE_DIR}
771758
STAMP_DIR ${STAMP_DIR}
772759
BINARY_DIR ${BINARY_DIR}
773-
${cmake_3_1_EXCLUDE_FROM_ALL}
760+
EXCLUDE_FROM_ALL 1
774761
CMAKE_ARGS
775762
# We shouldn't need to set this here, but INSTALL_DIR doesn't
776763
# seem to work, so instead I'm passing this through
@@ -783,7 +770,9 @@ if (CLANG_ENABLE_BOOTSTRAP)
783770
CMAKE_COMMAND ${cmake_command}
784771
INSTALL_COMMAND ""
785772
STEP_TARGETS configure build
786-
${cmake_3_4_USES_TERMINAL_OPTIONS}
773+
USES_TERMINAL_CONFIGURE 1
774+
USES_TERMINAL_BUILD 1
775+
USES_TERMINAL_INSTALL 1
787776
)
788777

789778
# exclude really-install from main target
@@ -792,7 +781,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
792781
COMMAND ${cmake_command} --build <BINARY_DIR> --target install
793782
COMMENT "Performing install step for '${NEXT_CLANG_STAGE}'"
794783
DEPENDEES build
795-
${cmake_3_4_USES_TERMINAL}
784+
USES_TERMINAL 1
796785
)
797786
ExternalProject_Add_StepTargets(${NEXT_CLANG_STAGE} really-install)
798787
add_custom_target(${NEXT_CLANG_STAGE}-install DEPENDS ${NEXT_CLANG_STAGE}-really-install)
@@ -808,7 +797,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
808797
COMMAND ${cmake_command} --build <BINARY_DIR> --target ${target}
809798
COMMENT "Performing ${target} for '${NEXT_CLANG_STAGE}'"
810799
DEPENDEES configure
811-
${cmake_3_4_USES_TERMINAL}
800+
USES_TERMINAL 1
812801
)
813802

814803
if(target MATCHES "^stage[0-9]*")

clang/runtime/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ if(NOT EXISTS ${COMPILER_RT_SRC_ROOT})
3434
endif()
3535

3636
if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
37-
if(CMAKE_VERSION VERSION_GREATER 3.3.20150708)
38-
set(cmake_3_4_USES_TERMINAL_OPTIONS
39-
USES_TERMINAL_CONFIGURE 1
40-
USES_TERMINAL_BUILD 1
41-
USES_TERMINAL_INSTALL 1
42-
)
43-
endif()
4437

4538
# Add compiler-rt as an external project.
4639
set(COMPILER_RT_PREFIX ${CMAKE_BINARY_DIR}/projects/compiler-rt)
@@ -86,7 +79,9 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
8679
${COMPILER_RT_PASSTHROUGH_VARIABLES}
8780
INSTALL_COMMAND ""
8881
STEP_TARGETS configure build
89-
${cmake_3_4_USES_TERMINAL_OPTIONS}
82+
USES_TERMINAL_CONFIGURE 1
83+
USES_TERMINAL_BUILD 1
84+
USES_TERMINAL_INSTALL 1
9085
)
9186

9287
get_ext_project_build_command(run_clean_compiler_rt clean)

0 commit comments

Comments
 (0)