Repository navigation
Compiler Option Target
Home › Compiler Option: -target
Set the target platform for cross compilation
Syntax
-target < platform >
Parameters
platform
The target platform. tiko recognizes three:
| Target | |
|---|---|
windows-x86_64 |
Windows on x86-64; the default on Windows |
linux-x86_64 |
Linux on x86-64; the default on Linux |
macos-arm64 |
macOS on Apple Silicon; the default on macOS. A program for it links on a Mac, with Apple's linker and SDK |
Any other name is refused with TKO0103.
Examples:
Description
The -target compiler option can be used to create an executable for a platform which is different from the host on which the source code is being compiled and linked. Appropriate libraries and cross compilation tools (assembler, linker) must be installed for cross compilation to work (also see FB and cross-compiling).
If -target <platform> is given, the compiler will compile programs more or less as if they were compiled on the given platform. This affects which __FB_*__ operating-system-specific symbol will be pre-defined, the default calling convention, the object and executable file format (e.g. ELF/COFF), the available runtime libraries and functions, etc.
With a standalone FB setup such as the FB-dos or FB-win32 releases:
With a normal FB setup such as the FB-linux release:
When using triplets they generally have the form os <arch>-<vendor>-<os> but can vary a lot between build systems or over time between different versions of a build system or toolchain. The compiler also accepts the form <arch>-<os> and is fairly permissive in what will be accepted and typically will not throw an error if at least part of the gnu triplet is recognized
For more details, see on page -buildprefix, the paragraph: "Detailed behavior if using -buildprefix, -prefix, -target command line options".
Version
See also
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing