@@ -394,9 +394,38 @@ If the specified version is unavailable and/or unknown to &SCons;,
394
394
a warning is issued showing the versions actually discovered,
395
395
and the build will eventually fail indicating a missing compiler binary.
396
396
If &cv-MSVC_VERSION; is not set, &SCons; will (by default) select the
397
- latest version of &MSVC; installed on your system.
397
+ latest version of &MSVC; installed on your system
398
+ (excluding any preview versions).
398
399
</para >
399
400
401
+ <note >
402
+ <para >
403
+ In order to take effect, &cv-MSVC_VERSION; must be set before
404
+ the initial &MSVC; compiler discovery takes place.
405
+ Discovery happens, at the latest, during the first call to the
406
+ &f-link-Environment; function, unless a <parameter >tools</parameter >
407
+ list is specified which excludes the entire &MSVC; toolchain -
408
+ that is, omits <literal >"defaults"</literal >
409
+ and any specific tool module that refers to parts of the toolchain
410
+ (&t-link-msvc; , &t-link-mslink; , &t-link-masm; , &t-link-midl;
411
+ and &t-link-msvs; ). In this case, detection is deferred until
412
+ any one of those tool modules is invoked manually.
413
+ The following two examples illustrate this:
414
+ </para >
415
+
416
+ <programlisting >
417
+ # MSVC_VERSION set as Environment is created
418
+ env = Environment(MSVC_VERSION='14.2')
419
+
420
+ # Initialization deferred with empty tools, triggered manually
421
+ env = Environment(tools=[])
422
+ env['MSVC_VERSION'] = '14.2
423
+ env.Tool('msvc')
424
+ env.Tool('mslink')
425
+ env.Tool('msvs')
426
+ </programlisting >
427
+ </note >
428
+
400
429
<para >
401
430
The valid values for &cv-MSVC_VERSION; represent major versions
402
431
of the compiler, except that versions ending in <literal >Exp</literal >
@@ -405,23 +434,6 @@ Values that do not look like a valid compiler version
405
434
<emphasis >string</emphasis > are not supported.
406
435
</para >
407
436
408
- <para >
409
- To have the desired effect, &cv-MSVC_VERSION; must be set before an msvc &f-link-Tool;
410
- (e.g., &t-link-msvc; ) or an msvc-dependent &f-link-Tool; (e.g., &t-link-midl; ) is loaded
411
- into the &consenv; .
412
- </para >
413
-
414
- <para >
415
- If the default tools list or an explicit tools list is used that includes an
416
- msvc &f-link-Tool; (e.g., &t-link-msvc; ) or an msvc-dependent &f-link-Tool; (e.g., &t-link-midl; );
417
- the &cv-MSVC_VERSION; is resolved when the &consenv; is created.
418
- In this case, passing &cv-MSVC_VERSION; as an argument in the &f-link-Environment; call
419
- is the effective solution.
420
- Otherwise, &cv-MSVC_VERSION; must be set before the first msvc &f-link-Tool; or
421
- msvc-dependent &f-link-Tool; is loaded into the environment.
422
- See the manpage section "Construction Environments" for an example.
423
- </para >
424
-
425
437
<para >
426
438
The following table shows the correspondence
427
439
of &cv-MSVC_VERSION; values to various version indicators
@@ -607,7 +619,7 @@ Visual Studio </literallayout></entry>
607
619
"Express" or "Express for Desktop" Visual Studio editions,
608
620
which had feature limitations compared to the full editions.
609
621
It is only necessary to specify the <literal >Exp</literal >
610
- suffix to select the express edition when both express and
622
+ suffix to select the express edition when both express and
611
623
non-express editions of the same product are installed
612
624
simulaneously. The <literal >Exp</literal > suffix is unnecessary,
613
625
but accepted, when only the express edition is installed.
@@ -860,56 +872,65 @@ The burden is on the user to ensure the requisite UWP libraries are installed.
860
872
<cvar name =" VSWHERE" >
861
873
<summary >
862
874
<para >
863
- Specify the location of <filename >vswhere.exe</filename >.
875
+ Specify the location of <command >vswhere.exe</command >.
864
876
</para >
865
877
866
878
<para >
867
- The <filename >vswhere.exe</filename > executable is distributed with Microsoft Visual Studio and Build
868
- Tools since the 2017 edition, but is also available as a standalone installation.
869
- It provides full information about installations of 2017 and later editions.
870
- With the <option >-legacy</option > argument, <filename >vswhere.exe</filename > can detect installations of the 2010 through 2015
871
- editions with limited data returned.
879
+ The <command >vswhere.exe</command > executable is distributed with
880
+ Microsoft Visual Studio and Build Tools since the 2017 edition,
881
+ but is also available as a standalone installation.
882
+ It allows queries to obtain detailed information about
883
+ installations of 2017 and later editions.
884
+ &SCons; makes use of this information to determine
885
+ the state of compiler support for those editions.
872
886
</para >
873
887
<para >
874
- If &cv-VSWHERE; is set to a <filename >vswhere.exe</filename > location, &SCons; will use that location.
875
- When &cv-VSWHERE; is undefined, &SCons; will look in the following locations and set &cv-VSWHERE; to the path
876
- of the first <filename >vswhere.exe</filename > located:
888
+ Setting the &cv-VSWHERE; variable to the path to a specific
889
+ <command >vswhere.exe</command > binary
890
+ causes &SCons; to use that binary.
891
+ If not set, &SCons; will search for one,
892
+ looking in the following locations in order,
893
+ using the first found
894
+ (&cv-VSWHERE; is updated with the location):
877
895
</para >
878
896
879
- <itemizedlist >
880
- <listitem >< para >< literal >%ProgramFiles(x86)%\Microsoft Visual Studio\Installer</literal ></para ></ listitem >
881
- <listitem >< para >< literal >%ProgramFiles%\Microsoft Visual Studio\Installer</literal ></para ></ listitem >
882
- <listitem >< para >< literal >%ChocolateyInstall%\bin</literal ></para ></ listitem >
883
- <listitem >< para >< literal >%LOCALAPPDATA%\Microsoft\WinGet\Links</literal ></para ></ listitem >
884
- <listitem >< para >< literal >~ \scoop\shims</literal ></para ></ listitem >
885
- <listitem >< para >< literal >%SCOOP%\shims</literal ></para ></ listitem >
886
- </itemizedlist >
897
+ <simplelist type = " vert " >
898
+ <member >< literal >%ProgramFiles(x86)%\Microsoft Visual Studio\Installer</literal ></member >
899
+ <member >< literal >%ProgramFiles%\Microsoft Visual Studio\Installer</literal ></member >
900
+ <member >< literal >%ChocolateyInstall%\bin</literal ></member >
901
+ <member >< literal >%LOCALAPPDATA%\Microsoft\WinGet\Links</literal ></member >
902
+ <member >< literal >%USERPROFILE% \scoop\shims</literal ></member >
903
+ <member >< literal >%SCOOP%\shims</literal ></member >
904
+ </simplelist >
887
905
888
- <para >
889
- Note that &cv-VSWHERE; must be set prior to the initial &MSVC; compiler discovery.
890
- For example, &cv-VSWHERE; must be set at the same time or before the first msvc &f-link-Tool;
891
- (e.g., &t-link-msvc; ) or msvc-dependent &f-link-Tool; (e.g., &t-link-midl; ) is initialized.
892
- </para >
893
906
894
- <para >
895
- Either set it as follows:
896
- <programlisting >
907
+ <note >
908
+ <para >
909
+ In order to take effect, &cv-VSWHERE; must be set before
910
+ the initial &MSVC; compiler discovery takes place.
911
+ Discovery happens, at the latest, during the first call to the
912
+ &f-link-Environment; function, unless a <parameter >tools</parameter >
913
+ list is specified which excludes the entire &MSVC; toolchain -
914
+ that is, omits <literal >"defaults"</literal >
915
+ and any specific tool module that refers to parts of the toolchain
916
+ (&t-link-msvc; , &t-link-mslink; , &t-link-masm; , &t-link-midl;
917
+ and &t-link-msvs; ). In this case, detection is deferred until
918
+ any one of those tool modules is invoked manually.
919
+ The following two examples illustrate this:
920
+ </para >
921
+
922
+ <programlisting >
923
+ # VSWHERE set as Environment is created
897
924
env = Environment(VSWHERE='c:/my/path/to/vswhere')
898
- </programlisting >
899
-
900
- Or, if your &consenv; is created specifying: (a) an empty tools list, or (b)
901
- a list of tools which omits all of default, msvc (e.g., &t-link-msvc; ), and
902
- msvc-dependent tools (e.g., &t-link-midl; ); and before &f-link-env-Tool;
903
- is called to initialize any of those tools:
904
925
905
- < programlisting >
906
- env = Environment(tools=[])
907
- env['VSWHERE'] = r'c:/my/vswhere/install/location/vswhere.exe'
908
- env.Tool('msvc')
909
- env.Tool('mslink')
910
- env.Tool('msvs')
911
- </programlisting >
912
- </para >
926
+ # Initialization deferred with empty tools, triggered manually
927
+ env = Environment(tools=[])
928
+ env['VSWHERE'] = r'c:/my/vswhere/install/location/vswhere.exe'
929
+ env.Tool('msvc')
930
+ env.Tool('mslink')
931
+ env.Tool('msvs')
932
+ </programlisting >
933
+ </note >
913
934
914
935
</summary >
915
936
</cvar >
0 commit comments