diff options
author | DRC <dcommander@users.sourceforge.net> | 2011-08-01 20:25:40 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2011-08-01 20:25:40 +0000 |
commit | cebb1ce44f31d541de5568264651ada3f9049299 (patch) | |
tree | 734c32b34c9234f227fa0861668bc4220e1e09da | |
parent | 1d03cbcc70e6275a96da1fa7f6afc89a5e8335f9 (diff) | |
download | tigervnc-cebb1ce44f31d541de5568264651ada3f9049299.tar.gz tigervnc-cebb1ce44f31d541de5568264651ada3f9049299.zip |
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
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
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 <stdio.h>\n #include <jpeglib.h>\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) |