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

Feature request: better support to entry options like "/SUBSYSTEM:WINDOWS" for GNU CLI #137

Open
Wongboo opened this issue Nov 14, 2021 · 1 comment

Comments

@Wongboo
Copy link

Wongboo commented Nov 14, 2021

This is sophiscated feature should be done step by step. when detect a link option like /SUBSYSTEM:WINDOWS, currently what we do is

if(MSVC)
          target_link_options(${PROJECT_NAME} PRIVATE  /SUBSYSTEM:WINDOWS)
endif()

We can add more support like this

if(MSVC)
#support for msvc and clang-cl(clang(MSVC CLI) for msvc)
   target_link_options(${PROJECT_NAME} PRIVATE  /SUBSYSTEM:WINDOWS)
elseif(CMAKE_COMPILER_IS_GNUCXX)
#support for mingw and clang for mingw
#mght loss for -municode for winmain
  target_link_options(${PROJECT_NAME} PRIVATE  -mwindows)
else()
#support for clang(GNU CLI) for msvc
#might loss for link "libcmt" "libcmtd" "libcmt.amd64" "libcmtd.amd64"
  target_link_options(${PROJECT_NAME} PRIVATE  -Xlinker /SUBSYSTEM:WINDOWS)      
endif()

looks like mingw and

@Aex12
Copy link

Aex12 commented Dec 4, 2021

I think that this would be amazing. I'm trying to compile a VS project on Linux, and it's being a pain in the ass. I stumbled upon this tool searching for ways to convert a VS project to CMake/Makefile, but felt very disappointed when I discovered that this only converts to other VS formats and doesn't allow to cross-compile with mingw.
With a feature like that, it would be a lot easier to compile VS projects on Linux.

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