MSBuild UNIX Native
This project adds support for building native code (C/C++) using MSBuild directly on UNIX platforms, using non-MSVC compiler toolsets.
Building
Source Code
Sources available at https://github.com/JunielKatarn/MSBuildUnixNative
.
Development Environment
These are the currently tested operating systems:
- Windows 10 - Creators Update, using Windows Subsystem for Linux (WSL).
- Ubuntu 16.04
- macOS 10.12 (Sierra)
Prerequisites
- .NET Core SDK
- LLVM/Clang compiler collection (version 5.0.0).
- Extract at
/opt/llvm/5.0.0
.
- Extract at
- Ubuntu 16.04:
libc6-dev
libgcc-5-dev
- (Optional) Visual Studio 2017 For the best editing/debugging experience, while deploying to WSL.
Build Steps
- Clone the repository
git clone git@github.com:JunielKatarn/MSBuildUnixNative.git
dotnet restore
dotnet msbuild
Usage
- Create a directory for your project, with two components:
- Source files
- Project file (i.e. myproject.proj)
<Project> <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" /> <PropertyGroup> <IntDir>obj/</IntDir> <OutDir>bin/</OutDir> </PropertyGroup> <ItemGroup> <PackageReference Include="LLVM.Build" /> </ItemGroup> <ItemGroup> <ClangCompile Include="source1.cpp" /> <ClangCompile Include="source2.cpp" /> ... <ClangCompile Include="sourceN.cpp" /> </ItemGroup> </Project>
- Restore .NET dependencies.
msbuild /t:Restore
- Build the project.
msbuild
License
MSBuildUnixNative is licensed under the MIT license.