-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
89 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## MACRO adapted from http://www.opensource.apple.com/source/curl/curl-57.2/curl/CMakeLists.txt licensed under the MIT license | ||
macro(COMPILE_TEST TEST_NAME) | ||
if(NOT DEFINED(${TESE_NAME})) | ||
set(MACRO_CHECK_FUNCTION_DEFINITIONS | ||
"-D${TEST_NAME} ${TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}") | ||
if(CMAKE_REQUIRED_LIBRARIES) | ||
set(TEST_NAME_ADD_LIBRARIES | ||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") | ||
endif(CMAKE_REQUIRED_LIBRARIES) | ||
|
||
message(STATUS "Performing Test ${TEST_NAME}") | ||
try_compile(${TEST_NAME} | ||
${CMAKE_BINARY_DIR} | ||
${CMAKE_SOURCE_DIR}/cmake/tests.c | ||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} | ||
"${TEST_NAME_ADD_LIBRARIES}" | ||
OUTPUT_VARIABLE OUTPUT) | ||
if(${TEST_NAME}) | ||
set(${TEST_NAME} 1 CACHE INTERNAL "Test ${FUNCTION}" PARENT_SCOPE) | ||
message(STATUS "Performing Test ${TEST_NAME} - Success") | ||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log | ||
"Performing Curl Test ${TEST_NAME} passed with the following output:\n" | ||
"${OUTPUT}\n") | ||
else(${TEST_NAME}) | ||
message(STATUS "Performing Test ${TEST_NAME} - Failed" PARENT_SCOPE) | ||
set(${TEST_NAME} "" CACHE INTERNAL "Test ${FUNCTION}") | ||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log | ||
"Performing Curl Test ${TEST_NAME} failed with the following output:\n" | ||
"${OUTPUT}\n") | ||
endif() | ||
else() | ||
message(STATUS "Skipped test ${TEST_NAME}") | ||
message(STATUS "${${TEST_NAME}}") | ||
endif() | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifdef TIME_WITH_SYS_TIME | ||
//Standard test for TIME_WITH_SYS_TIME | ||
|
||
#include <sys/types.h> | ||
#include <sys/time.h> | ||
#include <time.h> | ||
|
||
int | ||
main () | ||
{ | ||
if ((struct tm *) 0) | ||
return 0; | ||
; | ||
return 0; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters