Export symbols from `snappy_test_support` when building shared with MSVC
envgap__google__snappy-202
01 / FAILURE SIGNATURE
As reported upstream
The following error occurs:
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
b395cf7a4f79befdd60a0190bb903aa2135564ed- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
google/snappy #202 · read the original issue
When attempting to build a shared library with MSVC: ``` cmake .. -G "Ninja Multi-Config" -DCMAKE_BUILD_SHARED:BOOL=ON ``` The following error occurs: ``` [36/48] Linking CXX executable Release\snappy_test_tool.exe FAILED: Release/snappy_test_tool.exe cmd.exe /C "cd . && C:\Tools\cmake-3.25.2-windows-x86_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\snappy_test_tool.dir\Release --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\LTSC-17.8\PROFES~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo CMakeFiles\snappy_test_tool.dir\Release\snappy_test_tool.cc.obj /out:Release\snappy_test_tool.exe /implib:Release\snappy_test_tool.lib /pdb:Release\snappy_test_tool.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console Release\snappy_test_support.lib Release\snappy.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK: command "C:\PROGRA~1\MIB055~1\2022\LTSC-17.8\PROFES~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo CMakeFiles\snappy_test_tool.dir\Release\snappy_test_tool.cc.obj /out:Release\snappy_test_tool.exe /implib:Release\snappy_test_tool.lib /pdb:Release\snappy_test_tool.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console Release\snappy_test_support.lib Release\snappy.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:Release\snappy_test_tool.exe.manifest" failed (exit code 1181) with the following output: LINK : fatal error LNK1181: cannot open input file 'Release\snappy_test_support.lib' ``` This appears to be because no symbols are exported from the `snappy_test_support` library, and so a `.lib` file is not created. This works correctly for the `snappy` library, so the same logic should be applied to the `snappy_test_support` library.
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]