5 ms·
I want a doc like this, but targeting MS toolchains and libraries. gcc/make/bash/vim are already on my toolbelt regardless of OS I'm using. I've tried to get a
by sprayk 6y ago
I want a doc like this, but targeting MS toolchains and libraries. gcc/make/bash/vim are already on my toolbelt regardless of OS I'm using. I've tried to get a build system going a few times in MS land, but I'm too used to the relative simplicity of gcc and make files and find I have little patience for what feels like massive overkill for building simple command line tools.
- Iwan-Zotow 6y agoWhy do you want MS tools? Download LLVM for Windows, it produced native Win binaries, works well, you could use the same GCC flags
- Sindisil 6y agoOne option would be to use Visual Studio Build Tools (https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16 https://visualstudio.microsoft.com/thank-you-downloading-vis...). You could stick with makefiles by using nmake. It's not nearly as full featured as gnu make, and both cmd and PowerShell are much different (and less powerful in the case of cmd) to bash. Still and all, I've made it work quite well in the past for the Windows build of a library I was responsible for in my former day job. Another option would be to use cmake as your build tool and let it generate ninja, msbuild, or nmake scripts for you. It's not nearly as bad as it was in the past (nor as bad as some might lead to to believe). Worth a try, anyway.
- auxym 6y agoThere's also the option of going in .NET/C# land with the cross platform dotnet SDK (previously known as .NET Core): https://dotnet.microsoft.com/download https://dotnet.microsoft.com/download It's a CLI based full blown SDK including compiler, package manager and build tools, and it's cross platform.
- pjc50 6y agoI love C# and am very impressed with dotnet, but it still has a few limitations - to make it portable you have to ship the runtime with the application, it's not a ""real"" AOT compiled binary. And like all "portable" environments you quickly realize that some of the key native APIs aren't in the portable subset.
- pjc50 6y ago> I've tried to get a build system going a few times in MS land, but I'm too used to the relative simplicity of gcc and make files and find I have little patience for what feels like massive overkill for building simple command line tools. Embrace the target: use Visual Studio (community edition) You can still write in vim if you want, you just tab over and hit F5 when you want to run. MSBuild has a steep learning curve, but I've recently managed to climb it using https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-concepts?view=vs-2019 https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuil... Coming from make, a make target is a msbuild "item". Variables become properties. Build steps are "tasks" - generally you use the builtin ones.
- greggyb 6y agoVsVim is pretty good vim emulation for Visual Studio.
- jcelerier 6y ago> You can still write in vim if you want, you just tab over and hit F5 when you want to run. or just use cmake with nmake or ninja generator if you are that hellbent on using cl.exe
- pjc50 6y agoI'd like to ask the opposite question of this thread: why is everyone so hellbent on not using the Microsoft tooling?
- GoblinSlayer 6y agoPortability is more realistic with portable tooling.
- Iwan-Zotow 6y agoPortability it is really different... I'm using LLVM on Windows - native binaries, calls to clang and clang++ with the same options as gcc. So LLVM+cmake+ninja works reasnable well for medium sized project
- thefilmore 6y agoI wrote one [1] a while ago. [1] https://akr.am/blog/posts/a-guide-to-compiling-programs-on-windows https://akr.am/blog/posts/a-guide-to-compiling-programs-on-w...