Kaydet (Commit) b5e46045 authored tarafından Nick Treleaven's avatar Nick Treleaven

Add --no-preprocessing, -P option when generating tags files to

disable preprocessing of C/C++ source files.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1917 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 0dd090e6
......@@ -4,6 +4,9 @@
Also ignore Ctrl-L for VTE bash command.
Allow 'Switch to editor' command to override any bash commands.
Also disable the popup menu to avoid VTE bash conflicts.
* src/main.c, src/symbols.c, src/symbols.h:
Add --no-preprocessing, -P option when generating tags files to
disable preprocessing of C/C++ source files.
2007-09-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -104,6 +104,7 @@ static gboolean ignore_socket = FALSE;
#endif
static gboolean generate_datafiles = FALSE;
static gboolean generate_tags = FALSE;
static gboolean no_preprocessing = FALSE;
static gboolean ft_names = FALSE;
static gboolean no_plugins = FALSE;
......@@ -115,7 +116,8 @@ static GOptionEntry entries[] =
{ "debug", 'd', 0, G_OPTION_ARG_NONE, &debug_mode, N_("Runs in debug mode (means being verbose)"), NULL },
{ "ft-names", 0, 0, G_OPTION_ARG_NONE, &ft_names, N_("Print internal filetype names"), NULL },
{ "generate-tags", 'g', 0, G_OPTION_ARG_NONE, &generate_tags, N_("Generate global tags file (see documentation)"), NULL },
{ "generate-data-files", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &generate_datafiles, "", NULL },
{ "no-preprocessing", 'P', 0, G_OPTION_ARG_NONE, &no_preprocessing, NULL, NULL },
{ "generate-data-files", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &generate_datafiles, NULL, NULL },
#ifdef HAVE_SOCKET
{ "new-instance", 'i', 0, G_OPTION_ARG_NONE, &ignore_socket, N_("Don't open files in a running instance, force opening a new instance"), NULL },
#endif
......@@ -458,7 +460,7 @@ static void parse_command_line_options(gint *argc, gchar ***argv)
filetypes_init_types();
configuration_read_filetype_extensions(); // needed for *.lang.tags filetype matching
ret = symbols_generate_global_tags(*argc, *argv);
ret = symbols_generate_global_tags(*argc, *argv, ! no_preprocessing);
exit(ret);
}
......
......@@ -857,7 +857,7 @@ static filetype *detect_global_tags_filetype(const gchar *utf8_filename)
* the relevant path.
* Example:
* CFLAGS=-I/home/user/libname-1.x geany -g libname.d.tags libname.h */
int symbols_generate_global_tags(int argc, char **argv)
int symbols_generate_global_tags(int argc, char **argv, gboolean want_preprocess)
{
/* -E pre-process, -dD output user macros, -p prof info (?),
* -undef remove builtin macros (seems to be needed with FC5 gcc 4.1.1 */
......@@ -881,7 +881,7 @@ int symbols_generate_global_tags(int argc, char **argv)
g_printerr(_("Unknown filetype extension for \"%s\".\n"), tags_file);
return 1;
}
if (ft->lang == 0 || ft->lang == 1) /* C/C++ */
if (want_preprocess && (ft->id == GEANY_FILETYPES_C || ft->id == GEANY_FILETYPES_CPP))
command = g_strdup_printf("%s %s", pre_process, NVL(getenv("CFLAGS"), ""));
else
command = NULL; // don't preprocess
......
......@@ -44,7 +44,7 @@ void symbols_finalize();
gboolean symbols_recreate_tag_list(gint idx, gboolean sort_by_name);
gint symbols_generate_global_tags(gint argc, gchar **argv);
gint symbols_generate_global_tags(gint argc, gchar **argv, gboolean want_preprocess);
void symbols_show_load_tags_dialog();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment