mirror of
https://github.com/build-cpp/cmkr
synced 2026-06-08 13:22:55 +00:00
1004 B
1004 B
layout, title, permalink, parent, nav_order
| layout | title | permalink | parent | nav_order |
|---|---|---|---|---|
| default | Compiler flags | /examples/compile-options | Examples | 9 |
Compiler flags
Example project that sets compiler/linker flags for various platforms.
[project]
name = "compile-options"
description = "Compiler flags"
[target.hello]
type = "executable"
sources = ["src/main.cpp"]
msvc.compile-options = ["/W2"]
gcc.compile-options = ["-Wall"]
clang.compile-options = ["-Wall"]
The hello target uses conditions to set different compiler flags depending on the platform. See the targets documentation for other things you can set.
Note: In general you only want to specify flags required to compile your code without errors.
This page was automatically generated from tests/compile-options/cmake.toml.