pavelliavonau/cmakeconverter

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

Wongboo opened this issue · 1 comments

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 commented

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.