blob: 3d18f500e9e3bea67bcfe92db8be7e9c4f054a7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
#############################################################################
# INTEL CORPORATION PROPRIETARY INFORMATION #
# This software is supplied under the terms of a license agreement or #
# nondisclosure agreement with Intel Corporation and may not be copied #
# or disclosed except in accordance with the terms of that agreement. #
# Copyright (C) 2009 Intel Corporation. All Rights Reserved. #
#############################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
PROJECT(OCL)
set (LIBCL_DRIVER_VERSION_MAJOR 0)
set (LIBCL_DRIVER_VERSION_MINOR 2)
set (LIBCL_C_VERSION_MAJOR 1)
set (LIBCL_C_VERSION_MINOR 1)
configure_file (
"src/OCLConfig.h.in"
"src/OCLConfig.h"
)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_VERBOSE_MAKEFILE "false")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
SET(EMULATE_IVB false CACHE BOOL "To emulate IVB")
SET(EMULATE_SNB false CACHE BOOL "To emulate SNB")
SET(EMULATE_HSW false CACHE BOOL "To emulate HSW")
ADD_DEFINITIONS(-D__$(USER)__)
# Force Release with debug info
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RelWithDebInfo)
endif (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "assure config" FORCE)
message(STATUS "Building mode: " ${CMAKE_BUILD_TYPE})
SET(CMAKE_CXX_FLAGS_DEBUGO0 "-O0 -g")
SET(CMAKE_C_FLAGS_DEBUGO0 "-O0 -g")
IF (EMULATE_HSW)
SET (USE_FULSIM "true")
ADD_DEFINITIONS(-DEMULATE_GEN=75)
ELSEIF (EMULATE_IVB)
SET (USE_FULSIM "true")
ADD_DEFINITIONS(-DEMULATE_GEN=7)
ELSEIF (EMULATE_SNB)
SET (USE_FULSIM "true")
ADD_DEFINITIONS(-DEMULATE_GEN=6)
ELSE (EMULATE_IVB)
SET (USE_FULSIM "false")
ADD_DEFINITIONS(-DEMULATE_GEN=0)
ENDIF (EMULATE_HSW)
# XXX now hard coded to enable the clamp to border workaround for IVB.
ADD_DEFINITIONS(-DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND)
IF (USE_FULSIM)
ADD_DEFINITIONS(-DUSE_FULSIM=1)
ELSE (USE_FULSIM)
ADD_DEFINITIONS(-DUSE_FULSIM=0)
ENDIF (USE_FULSIM)
SET(CMAKE_CXX_FLAGS "-Wall -Wno-invalid-offsetof -mfpmath=sse -fno-rtti -Wcast-align -std=c++0x -msse2 -msse3 -mssse3 -msse4.1 ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-Wall -mfpmath=sse -msse2 -Wcast-align -msse2 -msse3 -mssse3 -msse4.1 ${CMAKE_C_FLAGS}")
# Front end stuff we need
#INCLUDE(CMake/FindLLVM.cmake)
Find_Package(LLVM 3.1)
# XLib
Find_Package(X11)
IF(X11_FOUND)
MESSAGE(STATUS "Looking for XLib - found")
ELSE(X11_FOUND)
MESSAGE(STATUS "Looking for XLib - not found")
ENDIF(X11_FOUND)
# DRM
Find_Package(DRM)
IF(DRM_FOUND)
MESSAGE(STATUS "Looking for DRM - found")
ELSE(DRM_FOUND)
MESSAGE(STATUS "Looking for DRM - not found")
ENDIF(DRM_FOUND)
# OpenGL
Find_Package(OpenGL)
# Threads
Find_Package(Threads)
# DRM Intel
Find_Package(DRMIntel)
IF(DRM_INTEL_FOUND)
MESSAGE(STATUS "Looking for DRM Intel - found")
ELSE(DRM_INTEL_FOUND)
MESSAGE(STATUS "Looking for DRM Intel - not found")
ENDIF(DRM_INTEL_FOUND)
# Xext
Find_Package(Xext)
IF(XEXT_FOUND)
MESSAGE(STATUS "Looking for Xext - found")
ELSE(XEXT_FOUND)
MESSAGE(STATUS "Looking for Xext - not found")
ENDIF(XEXT_FOUND)
# Xfixes
Find_Package(Xfixes)
IF(XFIXES_FOUND)
MESSAGE(STATUS "Looking for Xfixes - found")
ELSE(XFIXES_FOUND)
MESSAGE(STATUS "Looking for Xfixes - not found")
ENDIF(XFIXES_FOUND)
# Gen-backend (compiler)
Find_Package(GBE)
IF(GBE_FOUND)
MESSAGE(STATUS "Looking for Gen-Backend - found")
ELSE(GBE_FOUND)
MESSAGE(STATUS "Looking for Gen-Backend - not found")
ENDIF(GBE_FOUND)
Find_Package(EGL)
IF(EGL_FOUND)
MESSAGE(STATUS "Looking for EGL - found")
ELSE(EGL_FOUND)
MESSAGE(STATUS "Looking for EGL - not found")
ENDIF(EGL_FOUND)
IF(MESA_SOURCE_FOUND)
MESSAGE(STATUS "Looking for mesa source code - found")
ELSE(MESA_SOURCE_FOUND)
MESSAGE(STATUS "Looking for mesa source code - not found, cl_khr_gl_sharing will be disabled.")
ENDIF(MESA_SOURCE_FOUND)
Find_Package(OCLIcd)
IF(OCLIcd_FOUND)
MESSAGE(STATUS "Looking for OCL ICD header file - found")
ELSE(OCLIcd_FOUND)
MESSAGE(STATUS "Looking for OCL ICD header file - not found")
ENDIF(OCLIcd_FOUND)
Find_Package(PythonInterp)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(backend)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(utests)
|