-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rizin as subproject #4679
Rizin as subproject #4679
Conversation
@amibranch it breaks Windows builds:
|
Also pylint complains:
|
I guess this was introduced by one of the rebase-actions by myself. Will be fixed in a next push to this PR: #4680 (I rather want to work on a rebased state, to avoid any regressions). However, I just want to wait for all CI-Results - just in case |
meson.build
Outdated
@@ -564,12 +564,13 @@ if r.returncode() == 1 and get_option('subprojects_check') | |||
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.') | |||
endif | |||
|
|||
libzip_dep = dependency('libzip', required: get_option('use_sys_libzip'), static: is_static_build) | |||
libzip_dep = dependency('libzip', required: get_option('use_sys_libzip'), static: is_static_build, default_options: [ 'c_std=gnu99' ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libzip_dep = dependency('libzip', required: get_option('use_sys_libzip'), static: is_static_build, default_options: [ 'c_std=gnu99' ]) | |
libzip_dep = dependency('libzip', required: get_option('use_sys_libzip'), static: is_static_build, default_options: [ 'c_std=gnu99,c99' ]) |
Add also c99
as fallback, otherwise it will not compile on MSVC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed to make it conditional, as muon would throw an error:
/home/runner/work/rizin/rizin/meson.build:186:21: error ''gnu99,c99'' is not one of ['none', 'c89', 'c99', 'c11', 'c17', 'c18', 'c2x', 'gnu89', 'gnu99', 'gnu11', 'gnu17', 'gnu18', 'gnu2x']
186 | capstone_proj = subproject('capstone-' + capstone_version, default_options: ['default_library=static', 'c_std=gnu99,c99'])
^_________________________________________________________________________________________________________
subprojects/rzar/meson.build
Outdated
@@ -2,7 +2,7 @@ project('rzar', 'c', | |||
license: 'LGPL-3.0-only', | |||
meson_version: '>=0.55.0', | |||
default_options: [ | |||
'c_std=c99', | |||
'c_std=gnu99', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'c_std=gnu99', | |
'c_std=gnu99,c99', |
as fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace all those c_std=gnu99
with c_std=gnu99,c99
for compatibility with MSVC.
11487d4
to
d43f53e
Compare
we need to fix it in another PR, because usually we need some artifacts for a fallback repo. |
14793b8
to
d1b1bf2
Compare
Also removed an arg that is not allowed in muon and ignored by meson
d1b1bf2
to
7c09434
Compare
meson.build
Outdated
lang_opt = ['c_std=gnu99'] | ||
elif cc.has_argument('--std=c99') | ||
add_project_arguments('--std=c99', language: ['c', 'cpp']) | ||
lang_opt = ['c_std=c99'] | ||
else | ||
lang_opt = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to not do this. i prefer the c_std flags to be directly defined in subproject
also create a PR with a branch name containing the word dist
(required to run all the CIs) and close this and the other rebase pr. you can rebase in one PR directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR with new branch name has been created: #4684
subprojects/rzwinkd/meson.build
Outdated
default_options: [ | ||
'c_std=c99', | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define this instead of using add_project_arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, this cannot be designed conditional. However, the MSVC-Compiler could get problems with these flags, therefore we need to check cc.has_argument('--std=*'
. (It was missed here in the else-branch. However, in https://github.com/rizinorg/rizin/pull/4680/files#diff-d1ca507ad4335da90daae84cf012d657f3698491ecf5298a3e230442cf8f4ae1 it has been done as intended)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can always override c_std
like you do when you invoke default_options
, if instead you use add_project_arguments
then is more problematic.
99671e9
to
8ada452
Compare
For Muon, could you please open an issue there too?
I rebased my PR, lets see if it helps. |
As suggested in review, PR is replaced by: #4684 |
Your checklist for this pull request
Detailed description
Added some minor fixes that are relevant, if rizin is used as subproject:
extern "C"
linkage specification to some public headers of rizin (not specifically relevant for meson, but became necessary in a used project)add_global_link_arguments
withadd_project_link_arguments
(for the same reason, as whyadd_*_arguments
have been replaced)meson_git_wrapper.py
-script to explicitly specify the output-path, as currently thepwd
is chosen (which is always the top-build-dir. This leads to several problems, if used in subprojects (where the top rizin-build-dir is NOT the top build-dir)RIZIN_BUILD_PATH
conditional in the integration-test meson-build, as this makes problems in subprojects that do not configure thecli
-optionSome minor fixes to comply with CI
native
-arg that is not allowed and should not have any effect indeclare_dependency
c_std
default options for libzip, rzar and rzwinkd to be gnu99, as otherwise compile-errors occurred with glibcTest plan
TODO (mainly CI)
...
Closing issues
...