blob: 962a55ce86e849385157b138e82c5676adfdcbe9 [file] [log] [blame]
James Kuszmaulb13e13f2023-11-22 20:44:04 -08001import org.gradle.internal.os.OperatingSystem
2
3if (project.hasProperty('onlylinuxathena')) {
4 return;
5}
6
7description = "Process Starter"
8
9apply plugin: 'cpp'
10apply plugin: 'objective-cpp'
11apply plugin: 'visual-studio'
12apply plugin: 'edu.wpi.first.NativeUtils'
13
14ext {
15 nativeName = 'processstarter'
16}
17
18apply from: "${rootDir}/shared/config.gradle"
19
20// Replace shared crt with static crt.
21// Note this means no wpilib binaries can be dependencies
22nativeUtils.platformConfigs.named(nativeUtils.wpi.platforms.windowsx64).configure {
23 cppCompiler.debugArgs.remove('/MDd')
24 cppCompiler.debugArgs.add('/MTd')
25 cppCompiler.releaseArgs.remove('/MD')
26 cppCompiler.releaseArgs.add('/MT')
27}
28
29project(':').libraryBuild.dependsOn build
30
31model {
32 components {
33 "${nativeName}"(NativeExecutableSpec) {
34 baseName = 'processstarter'
35 binaries.all {
36 if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
37 it.buildable = false
38 return
39 }
40 if (it.targetPlatform.operatingSystem.isMacOsX()) {
41 it.sources {
42 macObjCpp(ObjectiveCppSourceSet) {
43 source {
44 srcDirs 'src/main/native/osx'
45 include '**/*.mm'
46 }
47 exportedHeaders {
48 srcDirs 'src/main/native/include'
49 include '**/*.h'
50 }
51 }
52 }
53 } else if (it.targetPlatform.operatingSystem.isLinux()) {
54 it.sources {
55 linuxCpp(CppSourceSet) {
56 source {
57 srcDirs 'src/main/native/linux'
58 include '**/*.cpp'
59 }
60 exportedHeaders {
61 srcDirs 'src/main/native/include'
62 include '**/*.h'
63 }
64 }
65 }
66 } else if (it.targetPlatform.operatingSystem.isWindows()) {
67 it.sources {
68 windowsCpp(CppSourceSet) {
69 source {
70 srcDirs 'src/main/native/windows'
71 include '**/*.cpp'
72 }
73 exportedHeaders {
74 srcDirs 'src/main/native/include'
75 include '**/*.h'
76 }
77 }
78 }
79 }
80 }
81 }
82 }
83}
84
85apply from: 'publish.gradle'