From 0e8f01a2f53cf574caf789d2c5136a750e6e73ce Mon Sep 17 00:00:00 2001 From: Grzegorz Wawiorko Date: Tue, 3 Dec 2019 10:27:22 +0100 Subject: [PATCH] cl12: GL sharing: Fix WIN compilation and add some clarification. (#333) * Fix WIN compilation and add some clarification. * Add CLConform_GL_LIBRARIES_DIR CmakeLists variable for GL support * GL sharing tests - library names justification * Fix compilation errors function are overridden in glext.h. * fix cl12 - Add CLConform_GL_LIBRARIES_DIR CmakeLists variable for GL support --- test_common/gl/gl_headers.h | 3 +-- test_common/gl/setup_win32.cpp | 2 -- test_conformance/CMakeLists.txt | 5 +++++ test_conformance/gl/CMakeLists.txt | 19 +++++++++---------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/test_common/gl/gl_headers.h b/test_common/gl/gl_headers.h index 3a42459e..8c151d4b 100644 --- a/test_common/gl/gl_headers.h +++ b/test_common/gl/gl_headers.h @@ -30,9 +30,8 @@ #ifdef _WIN32 #include #endif - #include + #include #include - #include #ifdef _WIN32 #include #else diff --git a/test_common/gl/setup_win32.cpp b/test_common/gl/setup_win32.cpp index b859a08e..bbcdf586 100644 --- a/test_common/gl/setup_win32.cpp +++ b/test_common/gl/setup_win32.cpp @@ -21,8 +21,6 @@ #include #include -#include -#include #include typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( diff --git a/test_conformance/CMakeLists.txt b/test_conformance/CMakeLists.txt index abec7bae..4711f9ba 100644 --- a/test_conformance/CMakeLists.txt +++ b/test_conformance/CMakeLists.txt @@ -4,6 +4,11 @@ option(D3D10_IS_SUPPORTED "Run DirectX 10 interop tests" OFF) option(D3D11_IS_SUPPORTED "Run DirectX 11 interop tests" OFF) option(GL_IS_SUPPORTED "Run OpenGL interop tests" OFF) +# CLConform_GL_LIBRARIES_DIR - path to OpenGL libraries +if(GL_IS_SUPPORTED AND CLConform_GL_LIBRARIES_DIR) + link_directories(${CLConform_GL_LIBRARIES_DIR}) +endif (GL_IS_SUPPORTED AND CLConform_GL_LIBRARIES_DIR) + if(MSVC) # The CTS will not link on MSVC 32-bit builds. To workaround this, add the # /LARGEADDRESSAWARE option as a linker flag. This is automatically set for diff --git a/test_conformance/gl/CMakeLists.txt b/test_conformance/gl/CMakeLists.txt index ec0ab0d7..1b045474 100644 --- a/test_conformance/gl/CMakeLists.txt +++ b/test_conformance/gl/CMakeLists.txt @@ -1,7 +1,13 @@ if(WIN32) -list(APPEND CLConform_LIBRARIES glut32 opengl32 glu32 ) +# Windows MSVC/Intel compiler hits: +# - dwonload free libraries package glew and glut/freeglut from the Internet +# - add x64/x86 binaries with glew and glut/freeglut libraries (.lib) to the directory lib/x64 or lib/x86. +# Include folder libs as cmake argument -DCLConform_GL_LIBRARIES_DIR=lib\x64 while solution generation +# - GL headers files should be added to project source directory and GL subdirectory +# - Add .dll files: glut glew to the test binary location. + list(APPEND CLConform_LIBRARIES opengl32 freeglut glew32) else(WIN32) -list(APPEND CLConform_LIBRARIES GL glut GLEW GLU) + list(APPEND CLConform_LIBRARIES GL glut GLEW GLU) endif(WIN32) set (GL_SOURCES @@ -29,7 +35,7 @@ set (GL_SOURCES ../../test_common/harness/mt19937.c ../../test_common/harness/testHarness.c ../../test_common/harness/threadTesting.c - ../../test_common/harness/imageHelpers.cpp + ../../test_common/harness/msvc9.c ) if (WIN32) @@ -49,13 +55,6 @@ if(MINGW) include_directories("./GLEW/") endif(MINGW) -if (MSVC) - if(CMAKE_CL_64) - list(APPEND CLConform_LIBRARIES glew64) - else(CMAKE_CL_64) - list(APPEND CLConform_LIBRARIES glew32) - endif(CMAKE_CL_64) -endif(MSVC) add_executable(conformance_test_gl ${GL_SOURCES} ${GLUT_SOURCES})