Build native library with BUCK for .NET (Mono, Xamarin)
Examples: - macOS on macOS (Mono, Xamarin.Mac, Unity) - `buck build //csharp:yoganet#shared,default` -> `libyoga.dylib` - Android (Xamarin.Android, Unity) - `buck build //csharp:yoganet#shared,android-armv7` -> `libyoga.so` - iOS (Xamarin.iOS, Unity) - `buck build //:yoga#static,iphoneos-arm64` -> `libyoga.a` - `buck build //csharp:yoganet#static,iphoneos-arm64` -> `libyoganet.a`
This commit is contained in:
8
BUCK
8
BUCK
@@ -7,14 +7,6 @@
|
|||||||
|
|
||||||
include_defs('//YOGA_DEFS')
|
include_defs('//YOGA_DEFS')
|
||||||
|
|
||||||
BASE_COMPILER_FLAGS = [
|
|
||||||
'-fno-omit-frame-pointer',
|
|
||||||
'-fexceptions',
|
|
||||||
'-Wall',
|
|
||||||
'-Werror',
|
|
||||||
'-O3',
|
|
||||||
]
|
|
||||||
|
|
||||||
GMOCK_OVERRIDE_FLAGS = [
|
GMOCK_OVERRIDE_FLAGS = [
|
||||||
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
||||||
'-Wno-inconsistent-missing-override',
|
'-Wno-inconsistent-missing-override',
|
||||||
|
@@ -17,6 +17,14 @@ CXX_LIBRARY_WHITELIST = [
|
|||||||
'//java:jni',
|
'//java:jni',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
BASE_COMPILER_FLAGS = [
|
||||||
|
'-fno-omit-frame-pointer',
|
||||||
|
'-fexceptions',
|
||||||
|
'-Wall',
|
||||||
|
'-Werror',
|
||||||
|
'-O3',
|
||||||
|
]
|
||||||
|
|
||||||
def yoga_dep(dep):
|
def yoga_dep(dep):
|
||||||
return '//' + dep
|
return '//' + dep
|
||||||
|
|
||||||
|
15
csharp/BUCK
15
csharp/BUCK
@@ -5,6 +5,10 @@
|
|||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
|
include_defs('//YOGA_DEFS')
|
||||||
|
|
||||||
|
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ['-std=c++11']
|
||||||
|
|
||||||
csharp_library(
|
csharp_library(
|
||||||
name = 'yogalibnet46',
|
name = 'yogalibnet46',
|
||||||
dll_name = 'Facebook.Yoga.dll',
|
dll_name = 'Facebook.Yoga.dll',
|
||||||
@@ -18,3 +22,14 @@ csharp_library(
|
|||||||
framework_ver = 'net45',
|
framework_ver = 'net45',
|
||||||
srcs = glob(['**/*.cs']),
|
srcs = glob(['**/*.cs']),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
cxx_library(
|
||||||
|
name = 'yoganet',
|
||||||
|
soname = 'libyoga.$(ext)',
|
||||||
|
srcs = glob(['Yoga/YGInterop.cpp']),
|
||||||
|
compiler_flags = COMPILER_FLAGS,
|
||||||
|
link_style = 'static',
|
||||||
|
link_whole = True,
|
||||||
|
deps = [yoga_dep(':yoga')],
|
||||||
|
visibility = ['PUBLIC'],
|
||||||
|
)
|
||||||
|
Reference in New Issue
Block a user