2020-07-30 22:39:39 +02:00
|
|
|
--- tools/gn/build/gen.py.orig 2020-07-07 22:09:39 UTC
|
2019-04-05 14:01:25 +02:00
|
|
|
+++ tools/gn/build/gen.py
|
2020-07-30 22:39:39 +02:00
|
|
|
@@ -78,6 +78,9 @@ class Platform(object):
|
2020-04-13 12:37:15 +02:00
|
|
|
def is_haiku(self):
|
|
|
|
return self._platform == 'haiku'
|
2019-01-07 20:47:18 +01:00
|
|
|
|
2019-02-24 11:52:51 +01:00
|
|
|
+ def is_freebsd(self):
|
|
|
|
+ return self._platform == 'freebsd'
|
2019-01-07 20:47:18 +01:00
|
|
|
+
|
|
|
|
def is_posix(self):
|
2020-04-13 12:37:15 +02:00
|
|
|
return self._platform in ['linux', 'freebsd', 'darwin', 'aix', 'openbsd', 'haiku']
|
2019-01-07 20:47:18 +01:00
|
|
|
|
2020-07-30 22:39:39 +02:00
|
|
|
@@ -372,6 +375,11 @@ def WriteGNNinja(path, platform, host, options):
|
2020-04-13 12:37:15 +02:00
|
|
|
elif platform.is_haiku():
|
|
|
|
cflags.append('-fPIC')
|
|
|
|
cflags.extend(['-D_BSD_SOURCE'])
|
2019-02-24 11:52:51 +01:00
|
|
|
+ elif platform.is_freebsd():
|
2019-01-07 20:47:18 +01:00
|
|
|
+ cflags.extend(['-Wno-deprecated-register', '-Wno-parentheses-equality'])
|
|
|
|
+ ldflags.extend(['-pthread'])
|
2019-02-24 11:52:51 +01:00
|
|
|
+ libs.extend(['-lexecinfo', '-lkvm', '-lutil'])
|
2019-01-07 20:47:18 +01:00
|
|
|
+ include_dirs += ['/usr/local/include']
|
2019-02-24 11:52:51 +01:00
|
|
|
|
2020-04-13 12:37:15 +02:00
|
|
|
if platform.is_posix() and not platform.is_haiku():
|
2019-02-24 11:52:51 +01:00
|
|
|
ldflags.append('-pthread')
|