Difference between revisions of "Compiler file"
(Started documenting format.) |
m (→See also: Make link absolute) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | [[Category:Code::Blocks Documentation]] | |
− | + | [[Category:Developer Documentation]] | |
− | + | Format for defining compiler interfaces using only XML (in conjunction with [[Compiler options file]]s). | |
− | |||
Line 22: | Line 21: | ||
<tt>weight="</tt><num><tt>"</tt> (optional) | <tt>weight="</tt><num><tt>"</tt> (optional) | ||
− | * Determines the order in the compiler drop-down menu that this compiler will be listed; lower numbers are listed sooner ( | + | * Determines the order in the compiler drop-down menu that this compiler will be listed; lower numbers are listed sooner (keep <num> between 0 and 100). |
<tt>platform="</tt><os><tt>"</tt> (optional). Only load this compiler if the current operating system is <os>. <os> is one of: | <tt>platform="</tt><os><tt>"</tt> (optional). Only load this compiler if the current operating system is <os>. <os> is one of: | ||
Line 34: | Line 33: | ||
* solaris | * solaris | ||
* unix</tt> | * unix</tt> | ||
+ | |||
+ | |||
+ | All of the following routines are used during auto-detection. | ||
+ | |||
+ | |||
+ | Conditional <tt><if>[...]</if><else>[...]</else></tt> statements are available in the same form as in [[Compiler options file]]s. | ||
Line 56: | Line 61: | ||
* If <tt>for</tt> is not specified, any path that exists will be added to the current <tt><Path type="..."></tt>. | * If <tt>for</tt> is not specified, any path that exists will be added to the current <tt><Path type="..."></tt>. | ||
* If <tt>for</tt> is given, the corresponding executable name will be replaced (if applicable; see <tt><if exec="..."></if></tt> blocks). If the specified file exists on any of the paths in the environment variable, those path(s) will be added. | * If <tt>for</tt> is given, the corresponding executable name will be replaced (if applicable; see <tt><if exec="..."></if></tt> blocks). If the specified file exists on any of the paths in the environment variable, those path(s) will be added. | ||
+ | If you do not have a <Search envVar= then the compiler auto detection code will not set the masterpath and cause compiler issues. | ||
(If the current path type is <tt>master</tt>, any trailing <tt>bin</tt> directories will be stripped.) | (If the current path type is <tt>master</tt>, any trailing <tt>bin</tt> directories will be stripped.) | ||
Line 64: | Line 70: | ||
</source> | </source> | ||
Same functionality as <tt><Search envVar="..."></tt> except that this tests a hard-coded path. | Same functionality as <tt><Search envVar="..."></tt> except that this tests a hard-coded path. | ||
+ | |||
+ | <source lang="xml" enclose="div"> | ||
+ | <Search path="C:\WinAVR*"/> | ||
+ | </source> | ||
+ | Wildcards are allowed in <tt><Search path="..."></tt>. | ||
<source lang="xml" enclose="div"> | <source lang="xml" enclose="div"> | ||
Line 76: | Line 87: | ||
</source> | </source> | ||
If the current <tt><Path type="..."></tt> is empty, add this path to it. | If the current <tt><Path type="..."></tt> is empty, add this path to it. | ||
+ | |||
+ | |||
+ | <source lang="xml" enclose="div"> | ||
+ | <Add><master/><separator/>lib</Add> | ||
+ | </source> | ||
+ | Add a path to the current <tt><Path type="..."></tt>. | ||
+ | * <tt><master/></tt> is replaced by the contents of the master path. | ||
+ | * <tt><separator/></tt> is replaced by the system's native file path separator. | ||
+ | |||
+ | |||
+ | <source lang="xml" enclose="div"> | ||
+ | <Add cFlag="-O"/> | ||
+ | </source> | ||
+ | Enable a compiler flag. | ||
+ | |||
+ | <source lang="xml" enclose="div"> | ||
+ | <Add lFlag="-s"/> | ||
+ | </source> | ||
+ | Enable a linker flag. | ||
+ | |||
+ | <source lang="xml" enclose="div"> | ||
+ | <Add lib="pthread"/> | ||
+ | </source> | ||
+ | Add a library. | ||
+ | |||
+ | ==See also== | ||
+ | * [[Compiler options file]] | ||
+ | * [https://forums.codeblocks.org/index.php/topic,16463.0.html XML based compilers] |
Latest revision as of 09:53, 26 May 2023
Format for defining compiler interfaces using only XML (in conjunction with Compiler options files).
<CodeBlocks_compiler name="Digital Mars Compiler"
id="dmc"
weight="24"
platform="windows">
[...]
</CodeBlocks_compiler>
I am a Code::Blocks compiler file.
name="<txt>"
- <txt> is the descriptive name that will be shown to the user for this compiler.
id="<id>"
- Lowercase sequence of letters, numbers, underscores, and/or hyphens (it must, however, start with a letter) which is used internally to represent this compiler.
weight="<num>" (optional)
- Determines the order in the compiler drop-down menu that this compiler will be listed; lower numbers are listed sooner (keep <num> between 0 and 100).
platform="<os>" (optional). Only load this compiler if the current operating system is <os>. <os> is one of:
- windows
- macosx
- linux
- freebsd
- netbsd
- openbsd
- darwin
- solaris
- unix
All of the following routines are used during auto-detection.
Conditional <if>[...]</if><else>[...]</else> statements are available in the same form as in Compiler options files.
<Path type="master">
[...]
</Path>
type="<tp>" Determines what variable the results of the contained detection routine(s) will be stored in. <tp> is one of:
- master
- extra
- include
- resource
- lib
<Search envVar="PATH"
for="C"/>
Searches all paths in the given environment variable.
- If for is not specified, any path that exists will be added to the current <Path type="...">.
- If for is given, the corresponding executable name will be replaced (if applicable; see <if exec="..."></if> blocks). If the specified file exists on any of the paths in the environment variable, those path(s) will be added.
If you do not have a <Search envVar= then the compiler auto detection code will not set the masterpath and cause compiler issues.
(If the current path type is master, any trailing bin directories will be stripped.)
<Search path="C:\MinGW"
for="C"/>
Same functionality as <Search envVar="..."> except that this tests a hard-coded path.
<Search path="C:\WinAVR*"/>
Wildcards are allowed in <Search path="...">.
<Search registry="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC"
value="InstallLocation"/>
Read a Windows registry key. If value is found in the registry key, and it is a valid folder, it will be added to the current <Path type="...">.
<Fallback path="/usr/local"/>
If the current <Path type="..."> is empty, add this path to it.
<Add><master/><separator/>lib</Add>
Add a path to the current <Path type="...">.
- <master/> is replaced by the contents of the master path.
- <separator/> is replaced by the system's native file path separator.
<Add cFlag="-O"/>
Enable a compiler flag.
<Add lFlag="-s"/>
Enable a linker flag.
<Add lib="pthread"/>
Add a library.