diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_indexer.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_indexer.htm index faf05baebbe..4c1005a43b6 100644 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_indexer.htm +++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_indexer.htm @@ -37,25 +37,20 @@ declarations and cross reference information. This is the recommended indexer. -

Related concepts
+

Related concepts
C/C++ search
-C/C++ Indexer Progress Bar

-

Related tasks
-Selection Searching for C/C++ -elements
-Setting Source Folders
+C/C++ Indexer Progress Bar
+Scanner Discovery

-

Related reference -
-C/C++ search page, Search -dialog box -
-C/C++ Project Properties, Indexer +

Related tasks
+Selection Searching for C/C++ elements
+Setting Source Folders

+

Related reference
+C/C++ search page, Search dialog box
+C/C++ Project Properties, Indexer
+

+

 

IBM Copyright Statement diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm index 6af3575e76a..c97355967a1 100644 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm +++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm @@ -23,13 +23,13 @@ If for any reason open declaration cannot find the declaration, it will display No declaration was found message. -

For more information see Adding Include paths and symbols.

+

For more information see Setting up include paths and macros for C/C++ indexer.

Related concepts
CDT Projects
C/C++ search

Related tasks
-Adding Include paths and symbols
+Setting up include paths and macros for C/C++ indexer
Navigate to a C or C++ element's declaration
Searching for C/C++ elements

diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_scanner_discovery.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_scanner_discovery.htm new file mode 100644 index 00000000000..ba333b2110d --- /dev/null +++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_scanner_discovery.htm @@ -0,0 +1,97 @@ + + + + + + + Scanner Discovery + + + +
+

Scanner Discovery

+

+Scanner Discovery (sometimes called Autodiscovery) is a method of finding include paths and predefined preprocessor macros which the compiler uses during compilation of the code. +

+ +

+Even a simplest C/C++ program just printing "Hello World" needs to include system headers. Consider: +

+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(void) {
+  puts("!!!Hello World!!!");
+  return EXIT_SUCCESS;
+}
+
+ +

+Indexer needs to be able to find headers stdio.h and stdlib.h and parse them to provide accurate index. +In this example, the headers define prototype of function puts and macro EXIT_SUCCESS. +

+ + +

+CDT will try to discover include paths and preprocessor symbols automatically for supported toolchains. +There are 2 main ways to discover those: +

+
    +
  1. Built-in Settings. +CDT will try to detect built-in compiler symbols and include paths running the compiler with special options and parse the output of this special run. +Most compilers provide such an option to print built-in include paths and symbols. Built-in settings are implied and do not get passed to compiler during regular compilation. +
  2. +
  3. Build Output Parser (BOP). +Another method that CDT employs is to analyze build output of the regular build with Build Output Parser. +Often, include paths are supplied to the compiler with -I options, and macros with -D options +and BOP will try to find those in the output. +That method relies on verbose build output of your build where all these options are actually printed by make. +
  4. +
+ +

+CDT uses Language Settings Providers to discover the settings (starting with version CDT 8.1). Typically Language settings Providers are specialized. +One will provide built-in compiler settings and another one settings detected by Build output Parser. +There is also an extension point defined in CDT to allow third party Eclipse plugins to contribute custom Language Settings Providers. +

+ +

+The setting entries found by Scanner Discovery can be inspected in project properties on "Preprocessor Include Paths, Macros etc." page. +Each Language Settings Provider can be expanded to show the entries it discovered. +

+ +

+Preprocessor Include Paths and Macros Entries +

+ + +

+If information retrieved by auto-discovery is insufficient or the project deviates from a standard one supported by CDT a user can enter additional include paths and macros manually under "User Settings Entries". +

+ +

+The Project Explorer View provides a means to view some of the settings. The discovered include paths are shown under the project when "Includes" node is expanded.
+Also, a "Wrench" overlay icon is shown for those file/folders where distinct entries are discovered which differ from those of parent folder. Wrench is not shown on project level.
+In the example below, Hello.cpp was compiled with added -DHELLO compiler option. +After BOP discovery "Wrench" overlay is shown for this file. +Project Explorer view +

+ + +

Related concepts
+C/C++ Indexer
+

+ +

Related tasks
+Setting up include paths and macros for C/C++ indexer
+

+ +

Related reference
+C/C++ Preferences: Scanner Discovery
+C/C++ Project properties: Preprocessor Include Paths, Macros, etc.
+

+ +
+ + diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm index c170436a50b..580c7b9c639 100644 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm +++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm @@ -14,6 +14,7 @@

This section describes the build views and terminology.

Building C/C++ Projects
+Scanner Discovery of include paths and preprocessor macros

IBM Copyright Statement

diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm index 67696fbb174..90f35b4e3a4 100644 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm +++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm @@ -40,7 +40,7 @@ --> Build
Building C/C++ Projects
- Manage Build Extensibility Document
+ Scanner Discovery of include paths and preprocessor macros
Debug
Breakpoints
Debug overview
diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_bop_options.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_bop_options.png new file mode 100644 index 00000000000..925e1420ba7 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_bop_options.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_preferences.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_preferences.png new file mode 100644 index 00000000000..ca563394d86 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_preferences.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_project_explorer.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_project_explorer.png new file mode 100644 index 00000000000..70f8325f48e Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_project_explorer.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_include.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_include.png new file mode 100644 index 00000000000..e604bdcee40 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_include.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_lse_kinds_dropdown.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_lse_kinds_dropdown.png new file mode 100644 index 00000000000..a580d3c044a Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_lse_kinds_dropdown.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_lse_paths_dropdown.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_lse_paths_dropdown.png new file mode 100644 index 00000000000..42f7a0f42e3 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_add_lse_paths_dropdown.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_entries.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_entries.png new file mode 100644 index 00000000000..c7468381b10 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_entries.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_providers.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_providers.png new file mode 100644 index 00000000000..b6033f76069 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_prop_providers.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_specs_detector_options.png b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_specs_detector_options.png new file mode 100644 index 00000000000..8e74aeb5460 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/scanner_discovery/sd_specs_detector_options.png differ diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_file.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_file.htm index 9b1d1b473c5..3c5661945d5 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_file.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_file.htm @@ -33,6 +33,7 @@
  • Symbols tab
  • Data Hierarchy tab
  • +
  • Preprocessor Include Paths, Macros, etc.
  • Run/Debug Settings page
  • diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_folder.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_folder.htm index 2f4197f4aa8..ca87a678686 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_folder.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_folder.htm @@ -35,6 +35,7 @@
  • Data Hierarchy tab
  • +
  • Preprocessor Include Paths, Macros, etc.
  • Run/Debug Settings page diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_proj.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_proj.htm index 07d61f51a60..aaf04b493f9 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_proj.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_prop_proj.htm @@ -68,6 +68,11 @@ To select project properties, right click a project and select Propertie
  • References tab
  • Data Hierarchy tab +
  • Preprocessor Include Paths, Macros, etc. +
  • C/C++ Project Properties, Project References page
  • C/C++ Project Properties, Run/Debug Settings page diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm index a0b8005d768..05c8058bf5b 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm @@ -46,7 +46,7 @@ Open Element
    Create a Make Target
    Find/Replace
    - C/C++ preferences
    + C/C++ Preferences
    Appearance
    Build preferences
    Error Parsers Options
    diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_pref.htm index 04662873960..d0c421b78e0 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_pref.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_pref.htm @@ -4,7 +4,7 @@ -C/C++ preferences +C/C++ Preferences diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build.htm index 6bb4a8609a1..54384e90943 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build.htm @@ -13,7 +13,7 @@

    Build preferences

    -

    Use the Build preference panel to define build options.

    +

    Use the Build preference panel to define build options.

    Related concepts
    diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_error_parsers.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_error_parsers.htm index d32a8ce53b5..7d41f8ecd8b 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_error_parsers.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_error_parsers.htm @@ -4,16 +4,16 @@ -Error Parser Options +Error Parser Preferences -

    Error Parser Options

    +

    Error Parser Preferences

    -

    Use the Error Parsers Tab on +

    Use the Error Parsers Tab on Build preference panel to define global error parsing options.

    Error Parsers scan build output looking for potential error or warning messages. diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_scanner_discovery.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_scanner_discovery.htm new file mode 100644 index 00000000000..0ae75fa321a --- /dev/null +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_scanner_discovery.htm @@ -0,0 +1,235 @@ + + + + + + + +Scanner Discovery Preferences + + + + + + +

    +

    Scanner Discovery Preferences

    + +

    General

    + +

    +Use the Discovery Tab on + Build preference panel to define global scanner discovery options. +

    +

    +In the Discovery tab you can see a list of Language Settings Providers. Language Settings Providers supply Language Settings such as include paths and preprocessor macros +for the indexer and other components of CDT. +

    +

    Scanner Discovery Preferences Panel

    + +

    +A user can define some properties for global (or "shared") providers on this preference. Note that providers can be either shared or defined per configuration. +Properties for non-shared providers can be defined in Project properties: Preprocessor Include Paths, Macros, etc. +

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Discovery tab
    GroupDescription
    Language Settings ProvidersLists the available language settings providers.
    Clear EntriesClick to clear all entries of the selected provider. + This operation takes effect after pressing "Apply" or "OK". + Normally this will trigger a rerun if the provider supplies built-in compiler settings. + Build output parsers will regain language settings after build while parsing new build output. +
    This operation might be unavailable if the provider does not have any language settings. + Some providers may not have the capability to clear. +
    ResetClick to reset options of the selected provider to default values. This operation also clears the provider entries. + The button can be enabled if some options in "Language Settings Provider Options" panel were changed. +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Kinds of Language Settings Providers
    ProviderDescription
    Build Output Parser ProviderBuild Output Parser Provider parses output of build + looking for include paths and macros passed to the compiler via compiler options. + Include files, macro files passed the the compiler and some other compiler options are normally also recognized. +
    + For gcc, include paths commonly passed with "-I" option and macros with "-D" option. + The language settings found by BOP are available after the build is finished. +
    Builtin Compiler Settings ProviderBuiltin Compiler Settings Provider launches the compiler with special options that instruct the compiler + to print built-in settings such as include paths to internal system headers and the list of internally predefined macros. + This provider is usually shared between projects in workspace and runs in background once. + When it is finished the language settings are available to all the projects between which it is shared. +
    Managed Build Language Settings ProviderMBS Provider supplies language settings provided by Managed Build System. +
    User Language Settings ProviderA user has an opportunity to enter language settings manually using this provider. + User Language Settings Provider should be normally the first in the list so these settings override settings supplied by other providers. +
    Contributed PathEntry ContainersThis provider is here for backward compatibility support of PathEntry Containers from older versions of CDT. + Using this method is not recommended. +
    Contributed ScannerInfo EntriesThis provider is here for backward compatibility support of ScannerInfo Entries from older versions of CDT. + Using this method is not recommended. +
    + +
    + +

    Language Settings Providers Options

    +

    +Language settings providers can have options that affect the behavior of a provider. These options are presented in "Language Settings Provider Options" panel. +

    + +

    Build Output Parser Options

    +

    BOP Options Panel

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Build Output Parser Options
    ProviderOptions
    Compiler command patternThe pattern which is used to recognize compiler command in build output. +
    Note that the pattern is Java regular expression pattern, it is NOT globbing pattern used to expand file name in command line. +
    Container to keep discovered entriesThe discovered entries can be associated with the project, enclosing folder or the file itself.
    Use heuristics to resolve pathsThe provider will try to find the best match for the discovered path in the project + or workspace trying several heuristics. If disabled, the discovered paths will stay as they appear in build output. +
    +
    + +

    Builtin Compiler Settings Provider Options

    +

    Specs Detector Options Panel

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Builtin Compiler Settings Provider Options
    ProviderOptions
    Command to get compiler specsThe command to make the compiler print built-in settings. + Following variables are recognized: +
      +
    • ${COMMAND} - compiler command from the toolchain, such as "gcc".
    • +
    • ${INPUTS} - indicates normally an empty specs file required by the compiler. + In no such file exists the file gets created temporarily in Eclipse workspace plugin area. +
    • +
    • ${EXT} - an extension for the language to discover built-in settings. + A provider can be associated with multiple languages and it will run the command for each language. +
    • +
    +
    BrowseUse this button to locate the compiler on the file system. + The result is put into "Command to get compiler specs" input field. +
    Allocate console in the Console ViewEnable to troubleshoot problems running the command. + When enabled, output of each run of the provider will be directed to a special console in the Console View. +
    + +

    +To see the entries a provider discovered, go to project properties (or the properties of the resource of interest), see +Project properties: Preprocessor Include Paths, Macros, etc. + +

    + +

    +A hint: After compiler upgrade re-discover changed settings with "Clear Entries" of the appropriate provider. +

    + + +

    Related concepts
    +Scanner Discovery
    +C/C++ Indexer
    +

    + +

    Related tasks
    +Setting up include paths and macros for C/C++ indexer
    +

    + +

    Related reference
    +C/C++ Project properties: Preprocessor Include Paths, Macros, etc.
    +

    + +
    + + \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_all.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_all.htm index ed3577ac324..60cef62e203 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_all.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_all.htm @@ -40,8 +40,8 @@ to handle configurations. -

    Related reference
    +

    +Related reference

    +
  • Preprocessor Include Paths, Macros, etc. +
  • C/C++ Project Properties, Project References page
  • C/C++ Project Properties, Refactoring History page
  • C/C++ Project Properties, Run/Debug Settings page diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_discovery.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_discovery.htm index 5fa70b890c2..a1f0083eab4 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_discovery.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_discovery.htm @@ -8,7 +8,7 @@ -

    Discovery Options properties

    +

    Discovery Options properties

    WarningNote that this functionality has been deprecated and not fully supported anymore

    Use the Discovery Options properties panel to control how information required to build your project is discovered, enhance search and Content Assist functionality, and automatically enhance your makefile, such as include paths and symbol definitions.

    Discovery options preference page

    diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general.htm index 13467635e4c..0edb3ffec6f 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general.htm @@ -9,14 +9,13 @@

    C/C++ Project Properties, C/C++ General

    General project properties

    -

    C/C++ Project Properties, C/C++ General

    +

    C/C++ Project Properties, C/C++ General

    Documentation tool comments
    Specifies which documentation tool should be used to determine editor presentation and behaviors. This enables editor features such as content-assist, documentation comment generation and syntax highlighting. The particular - tool selected here will be used for the files under this project and overrides the workspace level preference. + tool selected here will be used for the files under this project and overrides the workspace level preference. Note this preference is only available for the project level.

    Available for :
    Any projects, folders and files regardless of project kind
    @@ -72,6 +71,11 @@
  • References tab
  • Data Hierarchy tab +
  • Preprocessor Include Paths, Macros, etc. +
  • C/C++ Project Properties, Project References page
  • C/C++ Project Properties, Run/Debug Settings page diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_scanner_discovery.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_scanner_discovery.htm new file mode 100644 index 00000000000..4b754b9548f --- /dev/null +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_scanner_discovery.htm @@ -0,0 +1,46 @@ + + + + + + + +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. + + + + + + +

    C/C++ Project properties: Preprocessor Include Paths, Macros, etc.

    + +

    +Include paths and preprocessor macros for C/C++ indexer and other Language Settings are supplied by Language Settings Providers using Scanner Discovery mechanism. +

    +

    +The entries can be inspected and set up on project properties page "Preprocessor Include Paths, Macros, etc." - Entries tab. +

    + +

    +Language Settings Providers can be set up and configured for the selected configuration on project properties page "Preprocessor Include Paths, Macros, etc." - Providers tab. +

    + + +

    Related concepts
    +C/C++ Indexer
    +Scanner Discovery
    +

    + +

    Related tasks
    +Setting up include paths and macros for C/C++ indexer
    +

    + +

    Related reference
    +C/C++ Preferences: Scanner Discovery
    +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Entries tab
    +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Providers tab
    +

    + +
    + + \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_sd_entries.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_sd_entries.htm new file mode 100644 index 00000000000..3aa38d3e54b --- /dev/null +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_sd_entries.htm @@ -0,0 +1,200 @@ + + + + + + + +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Entries tab + + + + + + +

    C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Entries tab

    + +

    +Include paths and preprocessor macros for C/C++ indexer can be inspected and set up on the project property page "Preprocessor Include Paths, Macros, etc.", "Entries" tab. +This tab presents Language Settings Providers employed by Scanner Discovery to provide include paths, +macros and other Language Settings. +

    +

    +Note that the entries could be set also on an individual resource, such as file or folder. Open file or folder properties to inspect resource-specific entries. +The entries on a folder or a project will apply to all subfolders and C/C++ files under it - unless overriden on a lower level. +

    + +

    +"Entries" tab shows a list of Language Settings Providers for each language. A provider node can be expanded to show include paths and macros defined by the provider. +A user can add custom entries here under "User Setting Entries" provider. +

    +

    Scanner Discovery Properties Entry Panel

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Entries tab controls
    GroupDescription
    ConfigurationClick here for a description.
    Manage Configurations...Click here for a description.
    LanguagesLists all of the languages defined by the toolchain. Select a language to see the list of applicable providers.
    Setting EntriesLists all of the providers for the selected language and entries supplied by them. Expand a provider node to see the entries.
    Show built-in valuesDisable checkbox "Show built-in values" to filter out built-in setting entries in the view. + Built-in compiler entries need to be provided to C/C++ indexer but not to the compiler during the build. +
    Add...Add an entry to the provider. Enabled only when the provider supports the operation.
    Edit...Edit the selected settings entry. Enabled only when the provider supports the operation.
    DeleteDelete the selected settings entry. Enabled only when the provider supports the operation.
    Move UpMoves the selected entry higher in the list. Enabled only when the provider supports the operation
    Move DownMoves the selected entry lower in the list. Enabled only when the provider supports the operation
    +
    + +

    Adding and Editing entries

    +

    Use Add... and Edit... buttons to add or modify the entries. Both buttons open similar dialog described here.

    +

    Scanner Discovery Add Include Dialog

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Add/Edit entries dialog
    GroupDescription
    Kind of Setting EntryA dropbox to select desired kind of setting entry. + Scanner Discovery Kinds Dropdown
+						Following kinds are available:
+						- Include Directory
+						- Preprocessor Macro
+						- Include File
+						- Preprocessor Macros File
+						- Library Path
+						- Library +
    This dropbox is not available in "Edit" mode. +
    Kind of pathA dropbox to select desired kind of path. + Scanner Discovery Path Dropdown
+						Following kinds of paths are available:
+						- Project Path
+						- Workspace Path
+						- File System Path +
    This dropbox is shown for path entries only. +
    PathEnter path value of the entry. +
    This field is shown for path entries only. +
    Open folder buttonUse folder button to navigate folder structure to select existing path. + The provided dialog varies depending on the kind of path selected in the corresponding dropbox. +
    This button is shown for path entries only. +
    VariablesSelect one of the build or environment variables provided by CDT to embed into "Path" field. +
    This button is enabled only for File System Paths. +
    Treat as built-inEnable this checkbox to mark the entry as built-in. + Built-in compiler entries need to be provided to C/C++ indexer but not to the compiler during the build. +
    Contains system headersEnable if the include path is a system directory which contains system headers. +
    This checkbox is shown for Include Directories only. +
    Framework folderMac OS has a unique way of specifying include directories for Frameworks. + Enable if the included directory is Mac Framework directory. +
    This checkbox is shown for Include Directories only. +
    NameShown for Preprocessor Macro only. Specify the macro name here.
    ValueShown for Preprocessor Macro only. Specify the macro value here.
    +
    + + +

    Related concepts
    +Scanner Discovery
    +C/C++ Indexer
    +

    + +

    Related tasks
    +Setting up include paths and macros for C/C++ indexer
    +

    + +

    Related reference
    +C/C++ Preferences: Scanner Discovery
    +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Providers tab
    +

    + +
    + + \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_sd_providers.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_sd_providers.htm new file mode 100644 index 00000000000..4c82be8de90 --- /dev/null +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_sd_providers.htm @@ -0,0 +1,137 @@ + + + + + + + +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Providers tab + + + + + + +

    C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Providers tab

    + +

    +Include paths and preprocessor macros for C/C++ indexer and other Language Settings are supplied by Language Settings Providers as part of Scanner Discovery. +Language Settings Providers can be set up and configured for the selected configuration in the "Providers" tab. +

    +

    +"Providers" tab is only shown in properties of a project, not in properties of a file or a folder. +

    +

    Scanner Discovery Properties Providers Panel

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Providers tab controls
    GroupDescription
    ConfigurationClick here for a description.
    Manage Configurations...Click here for a description.
    Language Setting Providers listLists all of the providers available for the current configuration. Select the providers to assign to the configuration.
    Clear EntriesClears all entries of the selected provider. + This operation takes effect after pressing "Apply" or "OK". + Normally this will trigger a rerun if the provider supplies built-in compiler settings. + Build output parsers will regain language settings after build while parsing new build output. +
    This operation might be unavailable if the provider does not have any language settings. + Some providers may not have the capability to clear. +
    On this property page, this operation is applicable only to non-shared providers. +
    ResetResets options of the selected provider to default values. + This operation also clears the provider entries. + The button can be enabled if some options in "Language Settings Provider Options" panel were changed. +
    In this dialog, this operation is applicable only to non-shared providers. +
    Move UpMoves the selected provider higher in the list.
    Move DownMoves the selected provider lower in the list.
    +
    + + + +

    +A user can define some options for configuration providers (or "non-shared") on this property page. Note that providers can be either shared or defined per configuration. +Options of global (or "shared") providers can be configured on C/C++ Preferences: Scanner Discovery. +

    + +

    +There are 2 specific options that are added for non-shared providers defined per configuration. They are described in the table below. +

    + + + + + + + + + + + + + + + + + + + + + +
    Discovery tab
    GroupDescription
    Use global provider shared between projectsProviders can be global or belong to a configuration. Global providers share their entries between all configurations which refer to them. +
    Store entries in project settings folderProviders can persist their entries in workspace or under project folder. + Storing entries under project when approprate can make sharing with the other team members easier. +
    + +

    +The rest of the options is described in C/C++ Preferences: Scanner Discovery, under Language Settings Providers Options. +

    + + +

    Related concepts
    +Scanner Discovery
    +C/C++ Indexer
    +

    + +

    Related tasks
    +Setting up include paths and macros for C/C++ indexer
    +

    + +

    Related reference
    +C/C++ Preferences: Scanner Discovery
    +C/C++ Project properties: Preprocessor Include Paths, Macros, etc. - Entries tab
    +

    + +
    + + \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_properties.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_properties.htm index 8e30ce883ea..06b57c23857 100644 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_properties.htm +++ b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_properties.htm @@ -71,6 +71,11 @@ To select object properties, right click on object in view and select Pr
  • References tab
  • Data Hierarchy tab +
  • Preprocessor Include Paths, Macros, etc. +
  • C/C++ Project Properties, Project References page
  • C/C++ Project Properties, Run/Debug Settings page diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm index 2ca76f76d3b..b06b5a1fbae 100644 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm @@ -20,7 +20,7 @@ Converting CDT 1.x Projects
    Converting CDT Managed Make Projects
    Adding Convert to a C/C++ Make Project to the New menu
    - Set Discovery Options
    + Setting up include paths and macros for C/C++ indexer

    QNX Copyright Statement

  • diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm index 4131e4ce55d..336973b40d7 100644 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm @@ -79,6 +79,7 @@ Searching for C/C++ elements
    Selection Searching for C/C++ elements
    Setting Source Folders
    +Include paths and macros for C/C++ indexer

    QNX Copyright Statement

    diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_discovery.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_discovery.htm index 6e3c0cbc4f2..70b666d33d5 100644 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_discovery.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_discovery.htm @@ -8,6 +8,7 @@

    Set Discovery Options

    +

    WarningNote that this functionality has been deprecated and not fully supported anymore

    For most make projects, you will want to parse the output of the build to populate your paths and symbols tables.

    To populate your tables:

    diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm index 914011066cf..6e6a6ccad16 100644 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm @@ -12,7 +12,7 @@ function newWin(url) { -

    Adding Include paths and symbols

    +

    Adding Include paths and symbols in Managed Build System

    For CDT projects, you can define include paths and preprocessor symbols for the parser. This lets the parser understand the contents of the C/C++ source code so that you can more effectively use the search and code completion features.

    diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sd.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sd.htm new file mode 100644 index 00000000000..50ea7e1aa54 --- /dev/null +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sd.htm @@ -0,0 +1,64 @@ + + + + + + + + +Setting up include paths and macros for C/C++ indexer + + + + +
    +

    Setting up include paths and macros for C/C++ indexer

    + +

    +CDT allows for comfortable environment with code highlighting, navigation, content assist and static analysis. +However, most C/C++ projects have to be configured to enjoy those features. Most real life C/C++ projects heavily depend on code outside of the project itself, +such as system headers or third party libraries. CDT indexer needs to process those to provide accurate index. +Failure to set up these important settings assuredly will cause the assist tools misbehave. +

    + +

    CDT will try to discover include paths and preprocessor symbols automatically for supported toolchains. This process is known as Scanner Discovery or Autodiscovery. +This discovery of symbols is twofold. +One way, CDT will try to detect built-in compiler symbols and include paths running the compiler with special options and parse the output. +Another method that CDT employs is to analyze build output of the regular build with Build Output Parser. Often, include paths are supplied to the compiler with -I options, and macros with -D options. +That relies on verbose build output of your build where all these options are actually printed by make. +

    + +

    +Scanner Discovery uses Language Settings Providers to find include paths and preprocessor symbols. +Language Settings Providers can be configured on project properties page "Preprocessor Include Paths, Macros, etc.", Providers tab for a configuration +and on preference page C/C++ Preferences: Scanner Discovery for shared providers. +

    +

    +If information retrieved by auto-discovery is insufficient or the project deviates from a standard one supported by CDT a user can inspect discovered entries and enter additional include paths and macros manually +on the property page "Preprocessor Include Paths, Macros, etc.", Entries tab. +

    + + +

    +There are other ways to make C/C++ indexer aware of include paths or macros. One way is to set up them in MBS via "Paths and Symbols" project properties. +See Including paths and symbols in Managed Build System. These entries are supplied to the indexer with MBS Language Settings Provider. +

    + + +

    Related concepts
    +Scanner Discovery
    +C/C++ Indexer
    +

    + +

    Related tasks
    +Searching for C/C++ elements

    +

    + +

    Related reference
    +C/C++ Preferences: Scanner Discovery
    +C/C++ Project properties: Preprocessor Include Paths, Macros, etc.
    +

    + +
    + + \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm index 44b8ad2805e..3de3c8e5f34 100644 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm @@ -16,7 +16,7 @@ programs to ensure the accuracy of search results. It is important to familiarize yourself with the correct search syntax to use to complete an effective search. It is also important to ensure that include paths and symbols are correctly defined. For more information, see -Including paths and symbols.

    +Setting up include paths and macros for C/C++ indexer.

    See C/C++ search, for more information on:

    diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sel_search.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sel_search.htm index f43ec999a97..749cf6411f5 100644 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sel_search.htm +++ b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_sel_search.htm @@ -16,7 +16,7 @@ programs to ensure the accuracy of search results. It is important to familiarize yourself with the correct search syntax to use to complete an effective search. It is also important to ensure that include paths and symbols are correctly defined. For more information, see -Including paths and symbols.

    +Setting up include paths and macros for C/C++ indexer.

    See C/C++ search, for more information on:

    diff --git a/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml b/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml index cb732f914f0..2f50313bcfe 100644 --- a/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml +++ b/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml @@ -23,7 +23,8 @@ - + + diff --git a/doc/org.eclipse.cdt.doc.user/topics_Reference.xml b/doc/org.eclipse.cdt.doc.user/topics_Reference.xml index a5bc38419c1..dc81c74e83f 100755 --- a/doc/org.eclipse.cdt.doc.user/topics_Reference.xml +++ b/doc/org.eclipse.cdt.doc.user/topics_Reference.xml @@ -40,18 +40,14 @@ - - - - + + - - - - + + @@ -59,10 +55,9 @@ - + - @@ -70,6 +65,8 @@ + + @@ -102,8 +99,8 @@ - - + + @@ -115,9 +112,8 @@ - - - + + @@ -129,7 +125,7 @@ - + @@ -142,7 +138,7 @@ - + @@ -158,11 +154,15 @@ - - + + + + + + - + @@ -171,7 +171,7 @@ - + @@ -179,10 +179,11 @@ - - + + + - + @@ -192,26 +193,27 @@ - + - - + + + - + - - - - + + + + diff --git a/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml b/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml index b7a411204ce..afb719e5676 100644 --- a/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml +++ b/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml @@ -79,7 +79,7 @@ - + @@ -91,4 +91,6 @@ + +