mirror of
https://github.com/vlang/v.git
synced 2025-09-11 08:25:42 -04:00
tools: add a test for crosscompiling hw, on linux and macos, to FreeBSD (#21553)
This commit is contained in:
parent
98ea85170b
commit
463125e20a
@ -20,6 +20,8 @@ const hw_native_no_builtin_size_limit = 300
|
|||||||
|
|
||||||
const l2w_crosscc = os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32') or { '' }
|
const l2w_crosscc = os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32') or { '' }
|
||||||
|
|
||||||
|
const clang_path = os.find_abs_path_of_executable('clang') or { '' }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
mut commands := get_all_commands()
|
mut commands := get_all_commands()
|
||||||
// summary
|
// summary
|
||||||
@ -139,6 +141,23 @@ fn get_all_commands() []Command {
|
|||||||
runcmd: .execute
|
runcmd: .execute
|
||||||
expect: 'Hello, World!\n'
|
expect: 'Hello, World!\n'
|
||||||
}
|
}
|
||||||
|
if clang_path != '' {
|
||||||
|
res << Command{
|
||||||
|
line: '${vexe} -os freebsd -gc none examples/hello_world.v'
|
||||||
|
okmsg: 'V cross compiles hello_world.v, to a FreeBSD executable'
|
||||||
|
rmfile: 'examples/hello_world'
|
||||||
|
after_cb: fn () ! {
|
||||||
|
for file in ['examples/hello_world',
|
||||||
|
os.join_path(os.vmodules_dir(), 'freebsdroot/usr/include/stdio.h')] {
|
||||||
|
if !os.exists(file) {
|
||||||
|
return error('>> file ${file} does not exist')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
eprintln('Testing cross compilation to FreeBSD, needs clang.')
|
||||||
|
}
|
||||||
if os.getenv('V_CI_MUSL').len == 0 {
|
if os.getenv('V_CI_MUSL').len == 0 {
|
||||||
for compiler_name in ['clang', 'gcc'] {
|
for compiler_name in ['clang', 'gcc'] {
|
||||||
if _ := os.find_abs_path_of_executable(compiler_name) {
|
if _ := os.find_abs_path_of_executable(compiler_name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user