mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-08 08:09:42 -06:00
The MSVC linker needs to know what MSVC runtime a shared library needs. ISPC objects don't have a '/DIRECTIVE' entry for the MSVC runtime as they have no dependency on it. Therefore we need to add a C or C++ source to each shared library so the MSVC linker knows what runtime to embed
24 lines
358 B
C++
24 lines
358 B
C++
#include <stdio.h>
|
|
|
|
#include "extra.ispc.h"
|
|
|
|
#ifdef _WIN32
|
|
# define EXPORT __declspec(dllexport)
|
|
#else
|
|
# define EXPORT
|
|
#endif
|
|
|
|
EXPORT int extra()
|
|
{
|
|
float vin[16], vout[16];
|
|
for (int i = 0; i < 16; ++i)
|
|
vin[i] = i;
|
|
|
|
ispc::extra(vin, vout, 16);
|
|
|
|
for (int i = 0; i < 16; ++i)
|
|
printf("%d: extra(%f) = %f\n", i, vin[i], vout[i]);
|
|
|
|
return 0;
|
|
}
|