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

No support of more than one target type per target. (add_library doesn't support GenEx for target type) #78

Open
bigla opened this issue Jun 14, 2019 · 2 comments

Comments

@bigla
Copy link

bigla commented Jun 14, 2019

A week ago i converted a vcxproj containing

<ConfigurationType>StaticLibrary</ConfigurationType>
vs.
<ConfigurationType>DynamicLibrary</ConfigurationType>

for different Build Configurations.

  • I got:
    add_library(${PROJECT_NAME} SHARED ${ALL_FILES})

  • I expected some conversion similar to:

if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
add_library(${PROJECT_NAME} STATIC ${ALL_FILES})
else()
add_library(${PROJECT_NAME} SHARED ${ALL_FILES})
endif()

  • Parts of source .vcxproj:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup>

@pavelliavonau
Copy link
Owner

In this case you must get a warning like this(check your log):
"Target has more than one output binary type. CMake does not support it!"
It's tricky to implement this only for architectures. I prefer to leave it as it now. At least until upcoming release of cmakeconverter.
Also your example looks very synthetic. I think that cases like this are very rare in real life. The solution is - to create yet another target with necessary type.

@pavelliavonau pavelliavonau changed the title <ConfigurationType> per Build Configuration seems to be ignored. No support of more than one output binary type. (add_library doesn't support GenEx for target type) Jun 17, 2019
@pavelliavonau pavelliavonau changed the title No support of more than one output binary type. (add_library doesn't support GenEx for target type) No support of more than one target type per target. (add_library doesn't support GenEx for target type) Jun 17, 2019
@bigla
Copy link
Author

bigla commented Jun 25, 2019

To be honest I never worked with Visual Studio (Projects) before.
Other people configured the project that I am working on. I remember some explanation along the lines of "We do not have (source-of)libXY for x64, which is why we have to do it like this". Maybe that explanation is more useful for you than for me.

I do not intend to waste your time. And I am very thankful for your work!
I'll do my best to be as precise as possible with my descriptions and to be as helpful as i can.

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