From cebb1ce44f31d541de5568264651ada3f9049299 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 1 Aug 2011 20:25:40 +0000 Subject: Only try to run the libjpeg-turbo test program if we aren't cross-compiling. In a cross-compile environment, we'll settle for just making sure it compiles and links. Even though that can theoretically produce situations in which the wrong libjpeg is linked, such situations would be exceedingly rare in a cross-compile environment, since there is no "system libjpeg" to accidentally link with. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4611 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a3b23af..4a95961c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,7 +220,7 @@ if(MSVC) set(CMAKE_REQUIRED_DEFINITIONS -MT) endif() -check_c_source_runs("\n +set(JPEG_TEST_SOURCE "\n #include \n #include \n int main(void) {\n @@ -233,7 +233,13 @@ check_c_source_runs("\n cinfo.in_color_space = JCS_EXT_RGB;\n jpeg_default_colorspace(&cinfo);\n return 0;\n - }" FOUND_LIBJPEG_TURBO) + }") + +if(CMAKE_CROSSCOMPILING) + check_c_source_compiles("${JPEG_TEST_SOURCE}" FOUND_LIBJPEG_TURBO) +else() + check_c_source_runs("${JPEG_TEST_SOURCE}" FOUND_LIBJPEG_TURBO) +endif() set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_FLAGS) -- cgit v1.2.3