ENH: only run test for working c and cxx compiler once
This commit is contained in:
parent
93265d84be
commit
950399ec9d
|
@ -3,11 +3,14 @@
|
||||||
# and like the most basic of programs. If not, a fatel error
|
# and like the most basic of programs. If not, a fatel error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER}")
|
IF(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c "int main(){return 0;}")
|
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER}")
|
||||||
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c "int main(){return 0;}")
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
|
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
|
|
||||||
IF(NOT CMAKE_C_COMPILER_WORKS)
|
IF(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- broken")
|
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- broken")
|
||||||
MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
|
MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
|
||||||
|
|
|
@ -3,11 +3,13 @@
|
||||||
# and like the most basic of programs. If not, a fatel error
|
# and like the most basic of programs. If not, a fatel error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
|
IF(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx "int main(){return 0;}")
|
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
|
||||||
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx "int main(){return 0;}")
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
|
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
IF(NOT CMAKE_CXX_COMPILER_WORKS)
|
IF(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- broken")
|
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- broken")
|
||||||
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
|
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
|
||||||
|
|
Loading…
Reference in New Issue