Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List available compilers #16

Closed
Telokis opened this issue Jan 5, 2020 · 9 comments
Closed

List available compilers #16

Telokis opened this issue Jan 5, 2020 · 9 comments

Comments

@Telokis
Copy link
Contributor

Telokis commented Jan 5, 2020

The option -compiler allows the user to specify which compiler he wishes to use but there is no way to list what compilers are available (detected by sw).

I think a command sw list-compilers would be very useful.
It would also print the one that sw chose so the user know which one will be used when running commands without the -compiler option.

@egorpugin
Copy link
Contributor

egorpugin commented Jan 6, 2020

Initial implementation:

>sw -list-programs
List of detected programs:
  Microsoft Visual Studio C/C++ Compiler (short form - msvc):
    release:
      - 19.16.27034
      - 19.24.28314
    preview:
      - 19.24.28314-preview
  Clang C/C++ Compiler (short form - clang):
    release:
      - 10.0.0
  Clang C/C++ Compiler in MSVC compatibility mode (short form - clangcl):
    release:
      - 10.0.0

Use short program form plus version to select it for use.
short-version
Examples: msvc-19.16, msvc-19.24, clang-10

@egorpugin
Copy link
Contributor

egorpugin commented Jan 6, 2020

Also there's new -list-predefined-targets option.

>sw -list-predefined-targets
org.LLVM.ar-10.0.0
org.LLVM.clang-10.0.0
org.LLVM.clangcl-10.0.0
org.LLVM.clangpp-10.0.0
org.LLVM.lld-0.0.1
com.intel.compiler.c-19.0.4.245
com.intel.compiler.cpp-19.0.4.245
com.intel.compiler.lib-2019.4.245
com.intel.compiler.link-0.0.1
com.Microsoft.VisualStudio.VC.ATLMFC-15.9.28307.960
com.Microsoft.VisualStudio.VC.ATLMFC-16.5.29521.150-preview
com.Microsoft.VisualStudio.VC.ATLMFC-19.16.27034
com.Microsoft.VisualStudio.VC.ATLMFC-19.24.28314-preview
com.Microsoft.VisualStudio.VC.ATLMFC-19.24.28314
com.Microsoft.VisualStudio.VC.cl-19.16.27034
com.Microsoft.VisualStudio.VC.cl-19.24.28314-preview
com.Microsoft.VisualStudio.VC.cl-19.24.28314
com.Microsoft.VisualStudio.VC.concrt-15.9.28307.960
com.Microsoft.VisualStudio.VC.concrt-16.5.29521.150-preview
com.Microsoft.VisualStudio.VC.concrt-19.16.27034
com.Microsoft.VisualStudio.VC.concrt-19.24.28314-preview
com.Microsoft.VisualStudio.VC.concrt-19.24.28314
com.Microsoft.VisualStudio.VC.lib-19.16.27034
com.Microsoft.VisualStudio.VC.lib-19.24.28314-preview
com.Microsoft.VisualStudio.VC.lib-19.24.28314
com.Microsoft.VisualStudio.VC.libcpp-15.9.28307.960
com.Microsoft.VisualStudio.VC.libcpp-16.5.29521.150-preview
com.Microsoft.VisualStudio.VC.libcpp-19.16.27034
com.Microsoft.VisualStudio.VC.libcpp-19.24.28314-preview
com.Microsoft.VisualStudio.VC.libcpp-19.24.28314
com.Microsoft.VisualStudio.VC.link-19.16.27034
com.Microsoft.VisualStudio.VC.link-19.24.28314-preview
com.Microsoft.VisualStudio.VC.link-19.24.28314
com.Microsoft.VisualStudio.VC.ml-19.16.27034
com.Microsoft.VisualStudio.VC.ml-19.24.28314-preview
com.Microsoft.VisualStudio.VC.ml-19.24.28314
com.Microsoft.VisualStudio.VC.runtime-15.9.28307.960
com.Microsoft.VisualStudio.VC.runtime-16.5.29521.150-preview
com.Microsoft.VisualStudio.VC.runtime-19.16.27034
com.Microsoft.VisualStudio.VC.runtime-19.24.28314-preview
com.Microsoft.VisualStudio.VC.runtime-19.24.28314
com.Microsoft.Windows.rc-6.3.9600.17336
com.Microsoft.Windows.rc-10.0.10011.16384
com.Microsoft.Windows.SDK.ucrt-10.0.10240.0
com.Microsoft.Windows.SDK.ucrt-10.0.17763.0
com.Microsoft.Windows.SDK.ucrt-10.0.18362.0
com.Microsoft.Windows.SDK.um-8.1.0
com.Microsoft.Windows.SDK.um-10.0.10240.0
com.Microsoft.Windows.SDK.um-10.0.17763.0
com.Microsoft.Windows.SDK.um-10.0.18362.0
com.Microsoft.Windows.SDK.winrt-10.0.10240.0
com.Microsoft.Windows.SDK.winrt-10.0.17763.0
com.Microsoft.Windows.SDK.winrt-10.0.18362.0

@egorpugin
Copy link
Contributor

Update sw and try. Later we could improve output.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 6, 2020

Thank you!
Do you display the one that SW uses by default? It could be interesting to know.

@egorpugin
Copy link
Contributor

Oh, I did not mark it, by default it uses the latest version.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 6, 2020

Ok but how does it choose between msvc and clang, for instance?

@egorpugin
Copy link
Contributor

@Telokis
Copy link
Contributor Author

Telokis commented Jan 6, 2020

Oh I have no doubt about it, I'm not really asking the behavior (I can dive in the code if needed).
I just thought it would be more user-friendly to print in the output of the command

@egorpugin
Copy link
Contributor

It's ok for me to make initial implementation of features like this ticket and other your requests. But instead of tuning them precisely, I'd like to focus on more architectural questions to spend time there.

You could try to improve it further.
See changes c5c50cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants