mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Adds Objective C++ Build capabilities to cscore mac (#1029)
This commit is contained in:
committed by
Peter Johnson
parent
406e18663d
commit
1d6eb629ad
@@ -5,6 +5,10 @@ ext {
|
||||
devMain = 'edu.wpi.cscore.DevMain'
|
||||
}
|
||||
|
||||
if (OperatingSystem.current().isMacOsX()) {
|
||||
apply plugin: 'objective-cpp'
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
||||
|
||||
ext {
|
||||
@@ -15,6 +19,21 @@ ext {
|
||||
staticCvConfigs = [cscoreJNI: []]
|
||||
useJava = true
|
||||
useCpp = true
|
||||
splitSetup = {
|
||||
if (it.targetPlatform.operatingSystem.name == 'osx') {
|
||||
it.sources {
|
||||
macObjCpp(ObjectiveCppSourceSet) {
|
||||
source {
|
||||
srcDirs = ['src/main/native/objcpp']
|
||||
include '**/*.mm'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def examplesMap = [:];
|
||||
|
||||
12
cscore/src/main/native/objcpp/objcpptemp.mm
Normal file
12
cscore/src/main/native/objcpp/objcpptemp.mm
Normal file
@@ -0,0 +1,12 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface XYZPerson : NSObject
|
||||
- (void)sayHello;
|
||||
@end
|
||||
|
||||
|
||||
@implementation XYZPerson
|
||||
- (void)sayHello {
|
||||
NSLog(@"Hello, World!");
|
||||
}
|
||||
@end
|
||||
@@ -21,8 +21,10 @@ def macCompilerArgs = ['-std=c++14', '-Wall', '-Wextra', '-Werror', '-pedantic-e
|
||||
'-Wno-unused-const-variable', '-pthread']
|
||||
def macCCompilerArgs = ['-Wall', '-Wextra', '-Werror', '-pedantic-errors', '-fPIC', '-g',
|
||||
'-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-unused-private-field']
|
||||
def macObjCLinkerArgs = ['-std=c++14', '-stdlib=libc++','-fobjc-arc', '-g', '-fPIC', '-Wall', '-Wextra', '-Werror']
|
||||
def macReleaseCompilerArgs = ['-O2']
|
||||
def macDebugCompilerArgs = ['-O0']
|
||||
def macLinkerArgs = ['-framework', 'CoreFoundation', '-framework', 'AVFoundation', '-framework', 'Foundation', '-framework', 'CoreMedia', '-framework', 'CoreVideo']
|
||||
def mac32BitArg = '-m32'
|
||||
|
||||
def buildAll = project.hasProperty('buildAll')
|
||||
@@ -158,6 +160,8 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
CCompilerArgs = macCCompilerArgs
|
||||
debugCompilerArgs = macDebugCompilerArgs
|
||||
releaseCompilerArgs = macReleaseCompilerArgs
|
||||
objCppCompilerArgs = macObjCLinkerArgs
|
||||
linkerArgs = macLinkerArgs
|
||||
releaseStripBinaries = true
|
||||
compilerFamily = 'Clang'
|
||||
detectPlatform = mac64PlatformDetect
|
||||
|
||||
Reference in New Issue
Block a user