Add error when use --exe with --lib-create. (#3785)

This commit is contained in:
Yinan Xu 2022-11-29 19:37:38 +08:00 committed by GitHub
parent 68e1b473e2
commit e569ff2752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 0 deletions

View File

@ -133,6 +133,7 @@ Victor Besyakov
William D. Jones
Wilson Snyder
Xi Zhang
Yinan Xu
Yoda Lee
Yossi Nivin
Yuri Victorovich

View File

@ -761,6 +761,10 @@ void V3Options::notify() {
cmdfl->v3error("--make cannot be used together with --build. Suggest see manual");
}
if (m_exe && !v3Global.opt.libCreate().empty()) {
cmdfl->v3error("--exe cannot be used together with --lib-create. Suggest see manual");
}
// Make sure at least one make system is enabled
if (!m_gmake && !m_cmake) m_gmake = true;

View File

@ -18,6 +18,7 @@ compile (
"--timing",
],
verilator_make_gcc => 0,
make_main => 0,
fails => 1,
expect_filename => $Self->{golden_filename},
);

View File

@ -0,0 +1,2 @@
%Error: --exe cannot be used together with --lib-create. Suggest see manual
%Error: Exiting due to

View File

@ -0,0 +1,25 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2022 by Yinan Xu. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1);
compile (
verilator_flags2 => ["--protect-lib",
"secret",
"--protect-key",
"secret-key",
],
verilator_make_gcc => 0,
fails => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -17,6 +17,7 @@ compile (
"secret-key"
],
verilator_make_gcc => 0,
make_main => 0,
fails => 1,
expect_filename => $Self->{golden_filename},
);