Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
50db1a7e
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
1 年多 前同步成功
通知
36
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
50db1a7e
编写于
9月 30, 2019
作者:
M
Mark VanderVoord
提交者:
GitHub
9月 30, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #445 from michaelbadcrumble/fix_meson_support
Fix Meson build system support.
上级
e1381748
f4251bf8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
62 addition
and
100 deletion
+62
-100
examples/example_4/meson.build
examples/example_4/meson.build
+2
-5
examples/example_4/src/meson.build
examples/example_4/src/meson.build
+9
-19
examples/example_4/test/meson.build
examples/example_4/test/meson.build
+2
-4
examples/example_4/test/test_runners/meson.build
examples/example_4/test/test_runners/meson.build
+5
-13
meson.build
meson.build
+40
-51
src/meson.build
src/meson.build
+4
-8
未找到文件。
examples/example_4/meson.build
浏览文件 @
50db1a7e
###################################################################################
# #
# NAME:
examples/example_4/meson.build
#
# NAME:
meson.build
#
# #
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
# WRITTEN BY: Michael Brockus. #
...
...
@@ -9,12 +9,9 @@
# #
###################################################################################
project('example-4', 'c')
unity_dep = dependency('unity', fallback : ['unity', 'unity_dep'])
example_dir = include_directories('.', join_paths('.', 'src'))
subdir('src')
subdir('test')
\ No newline at end of file
subdir('test')
examples/example_4/src/meson.build
浏览文件 @
50db1a7e
###################################################################################
# #
# NAME:
examples/example_4/src/meson.build
#
# NAME:
meson.build
#
# #
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
# WRITTEN BY: Michael Brockus. #
...
...
@@ -9,23 +9,13 @@
# #
###################################################################################
inc_dir = include_directories('.')
lib_list = {'a': ['ProductionCode.c' ], 'b': ['ProductionCode2.c']}
foreach lib, src : lib_list
set_variable(lib + '_lib',
static_library(lib + '_lib', sources: src, include_directories: inc_dir))
endforeach
a_lib = library(
'production-code-1',
'ProductionCode.c',
include_directories: example_dir)
b_lib = library(
'production-code-2',
'ProductionCode2.c',
include_directories: example_dir)
a_dep = declare_dependency(
link_with: a_lib,
include_directories: example_dir)
b_dep = declare_dependency(
link_with: b_lib,
include_directories: example_dir)
\ No newline at end of file
a_dep = declare_dependency(link_with: a_lib, include_directories: inc_dir)
b_dep = declare_dependency(link_with: b_lib, include_directories: inc_dir)
examples/example_4/test/meson.build
浏览文件 @
50db1a7e
###################################################################################
# #
# NAME:
examples/example_4/test/meson.build
#
# NAME:
meson.build
#
# #
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
# WRITTEN BY: Michael Brockus. #
...
...
@@ -9,6 +9,4 @@
# #
###################################################################################
subdir('test_runners')
\ No newline at end of file
subdir('test_runners')
examples/example_4/test/test_runners/meson.build
浏览文件 @
50db1a7e
###################################################################################
# #
# NAME:
examples/example_4/test/test_runners/meson.build
#
# NAME:
meson.build
#
# #
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
# WRITTEN BY: Michael Brockus. #
...
...
@@ -9,16 +9,8 @@
# #
###################################################################################
cases = [['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c')],
['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')]]
test_src_1 = [
'TestProductionCode_Runner.c',
join_paths('..' ,'TestProductionCode.c')
]
test_src_2 = [
'TestProductionCode2_Runner.c',
join_paths('..' ,'TestProductionCode2.c')
]
test('Test production code one', executable('test-1', test_src_1, dependencies: [ a_dep, unity_dep ]))
test('Test production code two', executable('test-2', test_src_2, dependencies: [ b_dep, unity_dep ]))
\ No newline at end of file
test('Running: 01-test-case', executable('01-test-case', cases[0], dependencies: [ a_dep, unity_dep ]))
test('Running: 02-test-case', executable('02-test-case', cases[1], dependencies: [ b_dep, unity_dep ]))
meson.build
浏览文件 @
50db1a7e
...
...
@@ -12,69 +12,58 @@
project('unity', 'c',
version : '2.4.3',
license : 'MIT',
meson_version : '>=0.50.0',
default_options :
[
'werror=true',
default_options: [
'buildtype=minsize',
'optimization=3',
'warning_level=3',
'
b_sanitize=address,undefined',
'b_lto=true',
'b_lundef=true'
])
cc = meson.get_compiler(
'c'
)
args_for_langs = 'c'
'warning_level=3',
'
werror=true',
]
)
lang = 'c'
cc = meson.get_compiler(
lang
)
##
#
# Meson: Add compiler flags
#
##
if cc.get_id() == 'clang'
add_project_arguments(
'-Wweak-vtables',
'-Wexit-time-destructors',
'-Wglobal-constructors',
'-Wmissing-noreturn', language: args_for_langs)
add_project_arguments(cc.get_supported_arguments(
[
'-Wweak-vtables', '-Wexit-time-destructors',
'-Wglobal-constructors', '-Wmissing-noreturn'
]
), language: lang)
endif
if cc.get_argument_syntax() == 'gcc'
add_project_arguments(
'-Wall',
'-Wextra',
'-Wunreachable-code',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wredundant-decls',
'-Wundef',
'-Wwrite-strings',
'-Wformat',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wold-style-definition',
'-Winit-self',
'-Wmissing-include-dirs',
'-Waddress',
'-Waggregate-return',
'-Wno-multichar',
'-Wdeclaration-after-statement',
'-Wvla',
'-Wpointer-arith',language: args_for_langs)
add_project_arguments(cc.get_supported_arguments(
[
'-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar',
'-Wpointer-arith' , '-Wwrite-strings' ,
'-Wno-parentheses' , '-Wno-type-limits' ,
'-Wformat-security' , '-Wunreachable-code' ,
'-Waggregate-return' , '-Wformat-nonliteral' ,
'-Wmissing-prototypes' , '-Wold-style-definition' ,
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
'-Wno-unused-parameter' , '-Wdeclaration-after-statement'
]
), language: lang)
endif
if cc.get_id() == 'msvc'
add_project_arguments(
'/W4',
'/w44265',
'/w44061',
'/w44062',
'/wd4018', # implicit signed/unsigned conversion
'/wd4146', # unary minus on unsigned (beware INT_MIN)
'/wd4244', # lossy type conversion (e.g. double -> int)
'/wd4305', # truncating type conversion (e.g. double -> float)
mesno.get_supported_arguments(['/utf-8']), language: args_for_langs)
add_project_arguments(cc.get_supported_arguments(
[
'/w44265', '/w44061', '/w44062',
'/wd4018', '/wd4146', '/wd4244',
'/wd4305',
]
), language: lang)
endif
subdir('src')
unity_dep = declare_dependency(
version: meson.project_version(),
link_with: unity_lib,
include_directories: unity_dir)
\ No newline at end of file
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
src/meson.build
浏览文件 @
50db1a7e
###################################################################################
# #
# NAME:
src/meson.build
#
# NAME:
meson.build
#
# #
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
# WRITTEN BY: Michael Brockus. #
...
...
@@ -9,12 +9,8 @@
# #
###################################################################################
unity_src = files('unity.c')
unity_dir = include_directories('.')
unity_lib = library(meson.project_name(),
sources: unity_src,
include_directories: unity_dir)
\ No newline at end of file
unity_lib = static_library(meson.project_name(),
sources: ['unity.c'],
include_directories: unity_dir)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录