-
Notifications
You must be signed in to change notification settings - Fork 33
/
binding.gyp
106 lines (103 loc) · 3.59 KB
/
binding.gyp
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
{
'targets': [
{
'target_name': 'opencl',
'defines': [
'VERSION=0.4.5',
'NOCL_REALEASE_DRIVER_ISSUES'
],
'sources': [
'src/addon.cpp',
'src/types.cpp',
'src/common.cpp',
'src/commandqueue.cpp',
'src/context.cpp',
'src/device.cpp',
'src/event.cpp',
'src/kernel.cpp',
'src/memobj.cpp',
'src/pipe.cpp',
'src/platform.cpp',
'src/program.cpp',
'src/sampler.cpp',
'src/svm.cpp'
],
'include_dirs' : [
"<!(node -e \"require('nan')\")",
],
'conditions': [
['OS=="mac"', {
'include_dirs' : [
"<!(echo $OPENCL_HEADER)",
],
# 'make_global_settings': [
# ['CC', '/usr/bin/clang'],
# ['CXX', '/usr/bin/clang++'],
# ],
"xcode_settings": {
'OTHER_CPLUSPLUSFLAGS' : ['-mavx','-O3','-std=c++11','-stdlib=libc++','-Wall'],
'OTHER_LDFLAGS': ['-stdlib=libc++'],
'MACOSX_DEPLOYMENT_TARGET': '10.10'
},
'libraries': ['-framework OpenCL'],
}],
['OS in "linux freebsd openbsd solaris android"', {
'variables' : {
# AMD APP SDK
'AMD_OPENCL_SDK' : '<!(echo $AMDAPPSDKROOT)',
'AMD_OPENCL_SDK_INCLUDE' : '<(AMD_OPENCL_SDK)/include',
'AMD_OPENCL_SDK_LIB' : '<(AMD_OPENCL_SDK)/lib/x86_64',
# NVIDA CUDA SDK
'NVIDA_CUDA_SDK' : '<!(echo ${CUDA_PATH:-/usr/local/cuda})',
'NVIDA_CUDA_SDK_INCLUDE' : '<(NVIDA_CUDA_SDK)/include',
'NVIDA_CUDA_SDK_LIB' : '<(NVIDA_CUDA_SDK)/lib64',
},
'include_dirs' : [
"<(AMD_OPENCL_SDK_INCLUDE)", "<(NVIDA_CUDA_SDK_INCLUDE)"
],
'library_dirs' : [
"<(AMD_OPENCL_SDK_LIB)", "<(NVIDA_CUDA_SDK_LIB)"
],
'libraries': ['-lOpenCL'],
'cflags_cc': ['-std=c++11', '-Wall', '-O3', '-Wno-ignored-attributes']
}],
['OS=="win"', {
'variables' :
{
# AMD APP SDK
'AMD_OPENCL_SDK' : '<!(echo %AMDAPPSDKROOT%)',
'AMD_OPENCL_SDK_INCLUDE' : '<(AMD_OPENCL_SDK)\\include',
'AMD_OPENCL_SDK_LIB' : '<(AMD_OPENCL_SDK)\\lib\\x86_64',
# Intel OpenCL SDK
'INTEL_OPENCL_SDK' : '<!(echo %INTELOCLSDKROOT%)',
'INTEL_OPENCL_SDK_INCLUDE' : '<(INTEL_OPENCL_SDK)\\include',
'INTEL_OPENCL_SDK_LIB' : '<(INTEL_OPENCL_SDK)\\lib\\x64',
# NVIDA CUDA SDK
'NVIDA_CUDA_SDK' : '<!(echo %CUDA_PATH%)',
'NVIDA_CUDA_SDK_INCLUDE' : '<(NVIDA_CUDA_SDK)\\include',
'NVIDA_CUDA_SDK_LIB' : '<(NVIDA_CUDA_SDK)\\lib\\x64',
},
'include_dirs' : [
"<(AMD_OPENCL_SDK_INCLUDE)", "<(INTEL_OPENCL_SDK_INCLUDE)", "<(NVIDA_CUDA_SDK_INCLUDE)","<!(echo %OPENCL_HEADER%)",
],
'library_dirs' : [
"<(AMD_OPENCL_SDK_LIB)", "<(INTEL_OPENCL_SDK_LIB)", "<(NVIDA_CUDA_SDK_LIB)"
],
'defines' : [
# 'WIN32_LEAN_AND_MEAN',
'VC_EXTRALEAN',
],
'msvs_settings' : {
'VCCLCompilerTool' : {
'AdditionalOptions' : ['/O2','/Oy','/GL','/GF','/Gm-','/EHsc','/MT','/GS','/Gy','/GR-','/Gd']
},
'VCLinkerTool' : {
'AdditionalOptions' : ['/OPT:REF','/OPT:ICF','/LTCG']
},
},
'libraries': ['OpenCL.lib'],
},
],
]
}]
}