Skip to content

Commit

Permalink
fix build ccode
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed May 21, 2024
1 parent 4bd0a6d commit ea129e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 14 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ if get_option('ansi')
args += ['-ansi']
endif

# disable vala related warnings
args += ['-Wno-unused', '-Wno-unused-result', '-Wno-incompatible-pointer-types',
'-Wno-discarded-qualifiers', '-Wno-infinite-recursion', '-Wall', '-Wextra'
]

# some compiler flags from dpkg-buildpackage
args += ['-g', '-O2', '-Werror=implicit-function-declaration',
'-ffile-prefix-map=/root/ymp=.', '-fstack-protector-strong',
'-fstack-clash-protection', '-Wformat', '-Werror=format-security',
'-fcf-protection'
'-ffile-prefix-map=/root/ymp=.', '-fstack-protector-strong',
'-fstack-clash-protection', '-Wformat', '-Werror=format-security',
'-fcf-protection'
]

libc_srcs = []
Expand All @@ -50,7 +55,6 @@ else
endif


args += [meson.current_build_dir()/ 'obj.o']
deps = []

pkgconfig_arg = ''
Expand All @@ -64,7 +68,6 @@ else
endif

# valac configuration
add_project_arguments('-C', language: 'vala')
add_project_arguments(['--disable-assert', '--hide-internal', '--nostdpkg', '--enable-checking', '--abi-stability'], language: 'vala')
add_project_arguments('-D', '_GNU_SOURCE', '--disable-version-header', language: 'vala')
add_project_arguments(['--pkg', 'posix'], language: 'vala')
Expand Down Expand Up @@ -141,14 +144,13 @@ sources = ['src/ymp.vala',
'src/ccode.vala',
'data/ymp-extra.h'
]

sources += run_command('find', 'src/util','-type','f',check:true).stdout().strip().split('\n')
sources += run_command('find', 'src/operations','-type','f',check:true).stdout().strip().split('\n')
sources += run_command('find', 'src/data','-type','f',check:true).stdout().strip().split('\n')


foreach csource : run_command('find', 'src/ccode','-type','f',check:true).stdout().strip().split('\n')
args += [meson.current_source_dir() / csource]
sources += [meson.current_source_dir() / csource]
endforeach


Expand Down Expand Up @@ -215,6 +217,11 @@ add_project_arguments('-I'+meson.current_source_dir()+'/src/include/', language
add_project_arguments('-fPIC', language : 'c')
generated_sources += ['ctx.vala']

foreach arg : args
message(arg)
add_project_arguments(arg, language : 'c')
endforeach

########### build libymp ###########
if get_option('static')
libymp = static_library('ymp', generated_sources, dependencies: deps, link_args: args)
Expand Down
2 changes: 2 additions & 0 deletions src/ccode/archive-create.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
int aformat = 1;
int afilter = 0;

#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#endif

#ifndef no_libarchive
#include <sys/types.h>
Expand Down

0 comments on commit ea129e8

Please sign in to comment.