mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
allow os-specific filenames on interrogate command line
This commit is contained in:
parent
0c13c5c763
commit
baa5e959a5
@ -57,7 +57,7 @@ is_fully_specified() const {
|
|||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool CPPParser::
|
bool CPPParser::
|
||||||
parse_file(const string &filename) {
|
parse_file(const Filename &filename) {
|
||||||
if (!init_cpp(CPPFile(filename, filename, CPPFile::S_local))) {
|
if (!init_cpp(CPPFile(filename, filename, CPPFile::S_local))) {
|
||||||
cerr << "Unable to read " << filename << "\n";
|
cerr << "Unable to read " << filename << "\n";
|
||||||
return false;
|
return false;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "cppScope.h"
|
#include "cppScope.h"
|
||||||
#include "cppPreprocessor.h"
|
#include "cppPreprocessor.h"
|
||||||
|
#include "filename.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ public:
|
|||||||
|
|
||||||
virtual bool is_fully_specified() const;
|
virtual bool is_fully_specified() const;
|
||||||
|
|
||||||
bool parse_file(const string &filename);
|
bool parse_file(const Filename &filename);
|
||||||
|
|
||||||
CPPExpression *parse_expr(const string &expr);
|
CPPExpression *parse_expr(const string &expr);
|
||||||
CPPType *parse_type(const string &type);
|
CPPType *parse_type(const string &type);
|
||||||
|
@ -327,11 +327,11 @@ main(int argc, char *argv[]) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CO_oc:
|
case CO_oc:
|
||||||
output_code_filename = optarg;
|
output_code_filename = Filename::from_os_specific(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CO_od:
|
case CO_od:
|
||||||
output_data_filename = optarg;
|
output_data_filename = Filename::from_os_specific(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CO_module:
|
case CO_module:
|
||||||
@ -444,11 +444,12 @@ main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// Get all of the .h files.
|
// Get all of the .h files.
|
||||||
for (i = 1; i < argc; ++i) {
|
for (i = 1; i < argc; ++i) {
|
||||||
if (!parser.parse_file(argv[i])) {
|
Filename filename = Filename::from_os_specific(argv[i]);
|
||||||
|
if (!parser.parse_file(Filename::from_os_specific(filename))) {
|
||||||
cerr << "Error parsing file: '" << argv[i] << "'\n";
|
cerr << "Error parsing file: '" << argv[i] << "'\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
builder.add_source_file(argv[i]);
|
builder.add_source_file(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that we've parsed all the source code, change the way things
|
// Now that we've parsed all the source code, change the way things
|
||||||
@ -459,7 +460,7 @@ main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// Now look for the .N files.
|
// Now look for the .N files.
|
||||||
for (i = 1; i < argc; ++i) {
|
for (i = 1; i < argc; ++i) {
|
||||||
Filename nfilename = argv[i];
|
Filename nfilename = Filename::from_os_specific(argv[i]);
|
||||||
nfilename.set_extension("N");
|
nfilename.set_extension("N");
|
||||||
nfilename.set_text();
|
nfilename.set_text();
|
||||||
ifstream nfile;
|
ifstream nfile;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user