@@ -67,6 +67,7 @@ def check_version_info() -> None:
67
67
is_dragonflybsd = 'dragonfly' in _plat
68
68
is_bsd = is_freebsd or is_netbsd or is_dragonflybsd or is_openbsd
69
69
is_arm = platform .processor () == 'arm' or platform .machine () in ('arm64' , 'aarch64' )
70
+ c_std = '' if is_openbsd else '-std=c11'
70
71
Env = glfw .Env
71
72
env = Env ()
72
73
PKGCONFIG = os .environ .get ('PKGCONFIG_EXE' , 'pkg-config' )
@@ -498,7 +499,6 @@ def init_env(
498
499
cppflags .append ('-DDEBUG_{}' .format (el .upper ().replace ('-' , '_' )))
499
500
has_copy_file_range = test_compile (cc , src = '#define _GNU_SOURCE 1\n #include <unistd.h>\n int main() { copy_file_range(1, NULL, 2, NULL, 0, 0); return 0; }' )
500
501
werror = '' if ignore_compiler_warnings else '-pedantic-errors -Werror'
501
- std = '' if is_openbsd else '-std=c11'
502
502
sanitize_flag = ' ' .join (sanitize_args )
503
503
env_cflags = shlex .split (os .environ .get ('CFLAGS' , '' ))
504
504
env_cppflags = shlex .split (os .environ .get ('CPPFLAGS' , '' ))
@@ -508,7 +508,7 @@ def init_env(
508
508
509
509
cflags_ = os .environ .get (
510
510
'OVERRIDE_CFLAGS' , (
511
- f'-Wextra { float_conversion } -Wno-missing-field-initializers -Wall -Wstrict-prototypes { std } '
511
+ f'-Wextra { float_conversion } -Wno-missing-field-initializers -Wall -Wstrict-prototypes { c_std } '
512
512
f' { werror } { optimize } { sanitize_flag } -fwrapv { stack_protector } { missing_braces } '
513
513
f' -pipe -fvisibility=hidden { no_plt } '
514
514
)
@@ -1297,7 +1297,7 @@ def read_bool_options(path: str = 'kitty/cli.py') -> Tuple[str, ...]:
1297
1297
1298
1298
def build_launcher (args : Options , launcher_dir : str = '.' , bundle_type : str = 'source' ) -> str :
1299
1299
werror = '' if args .ignore_compiler_warnings else '-pedantic-errors -Werror'
1300
- cflags = f'-Wall { werror } -fpie' .split ()
1300
+ cflags = f'-Wall { werror } -fpie { c_std } ' . strip () .split ()
1301
1301
cppflags = [define (f'WRAPPED_KITTENS=" { wrapped_kittens ()} "' )]
1302
1302
ldflags = shlex .split (os .environ .get ('LDFLAGS' , '' ))
1303
1303
xxhash = xxhash_flags ()
0 commit comments