diff options
author | Aaron Watry <awatry@gmail.com> | 2012-11-14 20:09:52 -0600 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-11-16 17:11:43 -0500 |
commit | 31ab2d98c835ae6693ec002da470a59d1dd0eb29 (patch) | |
tree | 6858dd6f90c21ee9cf080659e36b154737104479 | |
parent | 10292fcddb07a08056bdd052b559968f0fe2e97d (diff) |
Fix MacOS build for OpenCL tests
1) Fix creation of libpiglitutil_cl.dylib
2) Fix includes of OpenCL.h to finish fixing MacOS build
Previous error message when linking dylib was:
Linking C shared library ../../../../lib/libpiglitutil_cl.dylib
Undefined symbols for architecture x86_64:
"_piglit_cl_get_test_config", referenced from:
_piglit_cl_framework_run in piglit-framework-cl.c.o
ld: symbol(s) not found for architecture x86_64
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
-rw-r--r-- | tests/util/CMakeLists.cl.txt | 6 | ||||
-rw-r--r-- | tests/util/piglit-util-cl-enum.h | 5 | ||||
-rw-r--r-- | tests/util/piglit-util-cl.h | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/tests/util/CMakeLists.cl.txt b/tests/util/CMakeLists.cl.txt index fac7695a..aa506366 100644 --- a/tests/util/CMakeLists.cl.txt +++ b/tests/util/CMakeLists.cl.txt @@ -3,9 +3,15 @@ include_directories( ${OPENCL_INCLUDE_PATH} ) +#MacOS has issues with linking a dylib with missing symbols without these flags +if (APPLE) + set(link_opts -Wl,-undefined,dynamic_lookup) +endif(APPLE) + link_libraries( piglitutil ${OPENCL_opencl_LIBRARY} + ${link_opts} ) piglit_add_library (piglitutil_${piglit_target_api} diff --git a/tests/util/piglit-util-cl-enum.h b/tests/util/piglit-util-cl-enum.h index cb4d8188..16c8d3e9 100644 --- a/tests/util/piglit-util-cl-enum.h +++ b/tests/util/piglit-util-cl-enum.h @@ -25,8 +25,11 @@ #ifndef PIGLIT_UTIL_CL_ENUM_H #define PIGLIT_UTIL_CL_ENUM_H +#ifdef __APPLE__ +#include <OpenCL/opencl.h> +#else #include <CL/opencl.h> - +#endif /** * \brief Convert a CL enum to a string. * diff --git a/tests/util/piglit-util-cl.h b/tests/util/piglit-util-cl.h index a19f8125..4420e32b 100644 --- a/tests/util/piglit-util-cl.h +++ b/tests/util/piglit-util-cl.h @@ -25,8 +25,6 @@ #ifndef PIGLIT_UTIL_CL_H #define PIGLIT_UTIL_CL_H -#include <CL/opencl.h> - #include "piglit-util.h" #include "piglit-util-cl-enum.h" |