You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I pass -DSPIRV_TOOLS_BUILD_STATIC=ON, there will be 3 targets:
${SPIRV_TOOLS}-shared
${SPIRV_TOOLS}-static
${SPIRV_TOOLS}
${SPIRV_TOOLS} is point to ${SPIRV_TOOLS}-shared or ${SPIRV_TOOLS}-static according to BUILD_SHARED_LIBS. that's okay, but I don’t know why SPIRV_TOOLS_BUILD_STATIC and SPIRV_TOOLS_LIBRARY_TYPE and BUILD_SHARED_LIBS can exist at the same time.
If we use BUILD_SHARED_LIBS, the generated library should have the same expectation as the value of BUILD_SHARED_LIBS: generate dynamic library, otherwise generate static library.
If I pass -DSPIRV_TOOLS_BUILD_STATIC=OFF, there will be 2 targets:
${SPIRV_TOOLS}-shared
${SPIRV_TOOLS}
${SPIRV_TOOLS} uses the same source files with ${SPIRV_TOOLS}-shared.
And if BUILD_SHARED_LIBS is ON, there will be 2 dynamic libraries!
On Windows, ${SPIRV_TOOLS} has exported symbols, and ${SPIRV_TOOLS}-shared doesn't export any symbols. I think that's not make sence: how to use a dynamic library that does not export any symbols?
On non-Windows, you will see SPIRV_TOOLS is same with ${SPIRV_TOOLS}-shared.
So my question is:
Why is there such a design?
What is the point of always generating dynamic libraries?
Why not just use BUILD_SHARED_LIBS or SPIRV_TOOLS_BUILD_STATIC or SPIRV_TOOLS_LIBRARY_TYPE ?
The text was updated successfully, but these errors were encountered:
JackBoosY
changed the title
Question about target ${SPIRV_TOOLS}-shared and ${SPIRV_TOOLS}
[cmake] Question about target ${SPIRV_TOOLS}-shared and ${SPIRV_TOOLS}
Jul 29, 2021
In the following code:
SPIRV-Tools/source/CMakeLists.txt
Lines 374 to 403 in 983ee23
There are two scenarios here:
-DSPIRV_TOOLS_BUILD_STATIC=ON
, there will be 3 targets:${SPIRV_TOOLS}
is point to${SPIRV_TOOLS}-shared
or${SPIRV_TOOLS}-static
according toBUILD_SHARED_LIBS
. that's okay, but I don’t know whySPIRV_TOOLS_BUILD_STATIC
andSPIRV_TOOLS_LIBRARY_TYPE
andBUILD_SHARED_LIBS
can exist at the same time.If we use
BUILD_SHARED_LIBS
, the generated library should have the same expectation as the value ofBUILD_SHARED_LIBS
: generate dynamic library, otherwise generate static library.-DSPIRV_TOOLS_BUILD_STATIC=OFF
, there will be 2 targets:${SPIRV_TOOLS}
uses the same source files with${SPIRV_TOOLS}-shared
.And if
BUILD_SHARED_LIBS
isON
, there will be 2 dynamic libraries!On Windows,
${SPIRV_TOOLS}
has exported symbols, and${SPIRV_TOOLS}-shared
doesn't export any symbols. I think that's not make sence: how to use a dynamic library that does not export any symbols?On non-Windows, you will see
SPIRV_TOOLS
is same with${SPIRV_TOOLS}-shared
.So my question is:
BUILD_SHARED_LIBS
orSPIRV_TOOLS_BUILD_STATIC
orSPIRV_TOOLS_LIBRARY_TYPE
?Related downstrem PR: microsoft/vcpkg#19219
The text was updated successfully, but these errors were encountered: