1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

Add generator code to build file and make script executable

This commit is contained in:
Peter Membrey
2021-04-04 01:54:43 +08:00
parent 61f4428435
commit 31f5b47fc5
2 changed files with 14 additions and 0 deletions

2
auto/generate_test_runner.rb Normal file → Executable file
View File

@@ -1,3 +1,5 @@
#!/usr/bin/ruby
# ========================================== # ==========================================
# Unity Project - A Test Framework for C # Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams

View File

@@ -12,3 +12,15 @@ project('unity', 'c',
subdir('src') subdir('src')
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir) unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
# Get the generate_test_runner script relative to itself or the parent project if it is being used as a subproject
# NOTE: This could be (and probably is) a complete hack - but I haven't yet been able to find a better way....
if meson.is_subproject()
gen_test_runner_path = find_program(meson.source_root() / 'subprojects/unity/auto/generate_test_runner.rb')
else
gen_test_runner_path = find_program('subprojects/unity/auto/generate_test_runner.rb')
endif
# Create a generator that we can access from the parent project
gen_test_runner = generator(gen_test_runner_path, output: '@BASENAME@_Runner.c', arguments: ['@INPUT@', '@OUTPUT@'] )