>> Hi, everyone. Today I'm going to
show you one of the latest features for
cross-platform C++ development in Visual Studio.
My name is Cinema Jett and I am
a Product Manager on the Microsoft Visual C++ team.
Now, Visual Studio provides the capability for users to
develop from the comfort of a Windows instance of Visual Studio,
even when they want to target a Mac with their application.
This is great and allows for users who love or want to try
a Visual Studio to use this powerful ID when
previously they weren't able to since they wanted to target
a Mac This is available on 17.3 Preview 2,
or later version of Visual Studio.
Feel free to download the latest version and give it a try.
Now, I will show you how to target
a Mac application from your Windows machine through Visual Studio.
For the sake of the demo,
I already have executed in the appropriate version of
See Make Ninja Build an Owl DB,
and my debugger already installed on my target Mac.
These can be downloaded from GitHub,
or a package manager.
Please note this remake needs to be installed
under your applications and be at least version 3.0.
If you want to learn more about
the commands you need to install these applications,
you can take a look at our blog post on ake.Ms/CPP blog.
These need to be installed for
the remote debugging to work properly,
but you may already have most of these already installed if you
have used your Mac for C++ development before.
First, we have to make sure
our Mac is enabled for remote connections.
To do that, we will go to system preferences,
and then select sharing,
and check your remote,
log in as selected and my user has access.
If the application has
a gooey remote management needs to be enabled as well.
I will note the global hostage of
this machine as I will need to plug it into
my connection manager on
Visual Studio to establish a remote connection.
Now that my Mac is set up for
C++ development and able to be promoted into,
I can now use Visual Studio on Windows to target this Mac.
Moving over to my Windows computer that I will be developing on,
I can open Visual Studio with the see
make repository I want to build on my Mac.
Then I'll open the connection manager.
As you can see, I already have a connection made to my target,
Mac's hostname username, and password.
If I want to add another connection,
I can simply add a new connection using
this button and add a new hostname username, and password.
Now it can be used as a CMAC target in either AC,
make settings or CMAC preset searches on configuration.
I will go to tools, options,
and CMAC to ensure that it always
uses see make presets such as configuration.
I'm using an open source project
that builds with CMAC for this demo,
but anything my project will work
as long as it can compile on a Mac.
From the first dropdown,
which is a targeted machine dropdown,
you can then select your target Mac machine,
which is this option.
This will start the CMAC generation for this machine.
This will take quite some time,
so I will skip forward to when this is complete.
Now that the CMAC generation is complete,
you can see that Visual Studio automatically to Texas
as a macOS debug system from the second dropdown.
Next, we can go to this first play button,
and select from the dropdown whichever
target application we want to run.
For this example, I'll just choose
a basic example with a [inaudible].
After I press "Play",
this will build on my Mac machine and
you'll be able to see the [inaudible] after some time.
I will come forward to when this is complete.
Now you can see that the [inaudible] is running on
my Mac machine while the application
is running on my Windows machine.
Additionally, there is remote debugging support available,
so I am able to set up
breakpoint using the left panel at anywhere in the code,
and the application will run and stop at this breakpoint and show
the status of various debugging variables within the MAC machine.
Additionally, there is IntelliSense functionality.
I can type up some code and you can see
that Visual Studio can detect what I
am trying to type using IntelliSense despite targeting a Mac.
That's everything you need to get started with targeting
a Mac machine from your Windows Visual Studio instance.
Currently, this only supports Macs with Intel X
64 chips on an OS version of at least 10.15 due to dependencies.
But, we are working to provide full M1 support soon.
For now, M1 users can use Rosetta to work around this.
Please let us know your thoughts on
the process and be sure to check out
the pure virtual C++ conference on April 26 for more C++ content.