Commit ba539d96 authored by Brad King's avatar Brad King

BUG: Make sure try-compile source ends in a newline.

parent 4bdc7833
......@@ -29,7 +29,7 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}")
"${SOURCE}\n")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
......
......@@ -29,7 +29,7 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}")
"${SOURCE}\n")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
......
......@@ -16,7 +16,7 @@ MACRO(TRY_COMPILE_FROM_SOURCE SOURCE VAR)
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src2.c"
"${src}")
"${src}\n")
EXEC_PROGRAM("${CMAKE_COMMAND}"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp"
ARGS -E copy src2.c src.c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment