mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-06 07:09:49 -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
361 B
C++
24 lines
361 B
C++
#include <stdio.h>
|
|
|
|
#include "simple.ispc.h"
|
|
|
|
#ifdef _WIN32
|
|
# define EXPORT __declspec(dllexport)
|
|
#else
|
|
# define EXPORT
|
|
#endif
|
|
|
|
EXPORT int simple()
|
|
{
|
|
float vin[16], vout[16];
|
|
for (int i = 0; i < 16; ++i)
|
|
vin[i] = i;
|
|
|
|
ispc::simple(vin, vout, 16);
|
|
|
|
for (int i = 0; i < 16; ++i)
|
|
printf("%d: extra(%f) = %f\n", i, vin[i], vout[i]);
|
|
|
|
return 0;
|
|
}
|