Brian Silverman | 41cdd3e | 2019-01-19 19:48:58 -0800 | [diff] [blame] | 1 | ext { |
| 2 | nativeName = 'cameraserver' |
| 3 | devMain = 'edu.wpi.first.cameraserver.DevMain' |
| 4 | } |
| 5 | |
| 6 | evaluationDependsOn(':ntcore') |
| 7 | evaluationDependsOn(':cscore') |
| 8 | evaluationDependsOn(':hal') |
| 9 | |
| 10 | apply from: "${rootDir}/shared/javacpp/setupBuild.gradle" |
| 11 | |
| 12 | dependencies { |
| 13 | compile project(':wpiutil') |
| 14 | compile project(':ntcore') |
| 15 | compile project(':cscore') |
| 16 | devCompile project(':wpiutil') |
| 17 | devCompile project(':ntcore') |
| 18 | devCompile project(':cscore') |
| 19 | } |
| 20 | |
| 21 | ext { |
| 22 | sharedCvConfigs = [cameraserver : [], |
| 23 | cameraserverBase: [], |
| 24 | cameraserverDev : [], |
| 25 | cameraserverTest: []] |
| 26 | staticCvConfigs = [:] |
| 27 | useJava = true |
| 28 | useCpp = true |
| 29 | } |
| 30 | |
| 31 | apply from: "${rootDir}/shared/opencv.gradle" |
| 32 | |
| 33 | model { |
| 34 | // Exports config is a utility to enable exporting all symbols in a C++ library on windows to a DLL. |
| 35 | // This removes the need for DllExport on a library. However, the gradle C++ builder has a bug |
| 36 | // where some extra symbols are added that cannot be resolved at link time. This configuration |
| 37 | // lets you specify specific symbols to exlude from exporting. |
| 38 | exportsConfigs { |
| 39 | cameraserver(ExportsConfig) { |
| 40 | x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure', |
| 41 | '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure', |
| 42 | '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range', |
| 43 | '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast'] |
| 44 | x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure', |
| 45 | '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure', |
| 46 | '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range', |
| 47 | '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast'] |
| 48 | } |
| 49 | } |
| 50 | components {} |
| 51 | binaries { |
| 52 | all { |
| 53 | if (!it.buildable || !(it instanceof NativeBinarySpec)) { |
| 54 | return |
| 55 | } |
| 56 | lib project: ':ntcore', library: 'ntcore', linkage: 'shared' |
| 57 | lib project: ':cscore', library: 'cscore', linkage: 'shared' |
| 58 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
| 59 | } |
| 60 | } |
| 61 | tasks { |
| 62 | def c = $.components |
| 63 | def found = false |
| 64 | def systemArch = getCurrentArch() |
| 65 | c.each { |
| 66 | if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") { |
| 67 | it.binaries.each { |
| 68 | if (!found) { |
| 69 | def arch = it.targetPlatform.architecture.name |
| 70 | if (arch == systemArch) { |
| 71 | def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib' |
| 72 | |
| 73 | found = true |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | } |