Comments (3)
I guess renaming them is a fair suggestion, the names were given with each platform's "default" configuration (Windows - MSVC, Linux - GCC/Clang, Mac - AppleClang) in mind, but putting those in the name instead would more clearly describe their intended usage to someone trying to use e.g. MinGW on Windows. As an FYI, some of the hardening flags are not applicable for AppleClang, that's why the *nix preset was split.
it does feel weird to require this sort of env-variable mangling
You shouldn't do that. You can provide CMake with the flags using a toolchain file. Tooling will still understand the build perfectly fine if you instead load a toolchain file in the preset. Toolchain files are just CMake scripts, where you can put some sort of logic to better select flags that are currently in the presets, but I would heavily recommend keeping that logic very light. Remember that the whole point of the presets is to externalize things that aren't pertinent to build and usage requirements.
from cmake-init.
I am aware that the flags presets are repetitive and that they don't cover every possible setup, which is mentioned in the non-goals of this project: https://github.com/friendlyanon/cmake-init#non-goals
The idea behind the flags is that they are mainly for CI that also happens to work on "default" configurations with good enough experience. $env{}
will definitely not be abused.
User presets can and are meant to also be freely used to override parts of the main presets. With that in mind, I'm not sure what to change in that regard. Regarding MinGW, that was looked at in #89 and I don't see what needs to be done here. MinGW is definitely not the norm for Windows, so I would rather not have it in cmake-init by default.
Fortify not working with ASAN was no something I was aware of though. From what I read, it's best to just remove the -D
one in this case.
from cmake-init.
that they don't cover every possible setup, which is mentioned in the non-goals of this project: https://github.com/friendlyanon/cmake-init#non-goals
That's fair, and I don't think it's reasonable to expect cmake-init
to support every possible combination of compiler and platform there is. However, I think renaming what is already present would make things clearer—the real difference between the flags-linux
+ flags-darwin
and flags-windows
sets are the syntax of the driver flags, rather than the OS they're running on.
$env{}
will definitely not be abused
Bummer. This is a CMake limitation, honestly, and it does feel weird to require this sort of env-variable mangling...
MinGW
Simply put, flags-windows
can't be used to compile with MinGW, simply because the tools provided by MinGW don't accept cl
-style flags (it is called Minimalist GNU for Windows). Ergo I said flags-linux
is not particularly well-named: it doesn't really contain anything strictly Linux-specific, is in the GNU style of compiler arguments, and it could be set up by end-users to compile for any platform that uses GCC, Clang, ICX, NVCC, or any number of compilers that have a shared GNU-like heritage.
Ergo this whole renaming exercise.
from cmake-init.
Related Issues (20)
- ERROR: uninitialized variable 'CMAKE_CONFIGURATION_TYPES' HOT 1
- The generated example does not compile on ubuntu 22.04 with c++ std 20? HOT 1
- cmake-init ci-windows and dev-win64 always output to Debug even if CMAKE_BUILD_TYPE is set to Release HOT 1
- error: option 'cf-protection=return' cannot be specified on this target (maxos-14) HOT 4
- Conan: add an option that would help choosing between generating a .txt or a .py file HOT 2
- clang-tidy warning due to readability-identifier-naming HOT 2
- `sanitize` job fails in new project HOT 3
- `fmt/core.h` not found HOT 6
- Spell and grammar checking
- Add sanitizer option to user presets HOT 5
- Why is the template generate a CMakeUserPresets, should not those be outside of git and local to the dev own setup?
- Showcase insertion of CMake variables via `configure_file()` HOT 3
- Conan v2 template HOT 3
- Mingw support in cmake-init HOT 1
- MSVC's /analyze is erroneous and slow
- It seems that my previous installation of Visual Studio 2022 edited my configurations HOT 2
- Errors with `-fcf-protection=full` on darwin (CMakePresets.json, "flags-darwin" preset) HOT 2
- Runtime error (Error code: 0xc0000135) when building shared libraries on Windows using MSVC HOT 3
- Setting `-D<project>_INSTALL_CMAKEDIR=something` produces unexpected results HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmake-init.