h3 icon indicating copy to clipboard operation
h3 copied to clipboard

Fix testing Windows shared object build

Open isaacbrodsky opened this issue 5 years ago • 1 comments

As noted in #365 it looks like build is broken without using -DBUILD_TESTING=OFF and -DBUILD_GENERATORS=OFF. This means we can't run the tests on shared object builds.

The issue with h3WithTestAllocators is probably the same as was seen on Mac OSX where a special build option is needed to have unknown symbols be looked up dynamically. Edit: Perhaps this can be done with https://docs.microsoft.com/en-us/cpp/build/reference/force-force-file-output?view=vs-2019 but this does not sound like a recommended approach.

generateFaceCenterPoint unsure why this one is not working for me. Edit: Probably the symbol is not exported automatically as it's a const variable rather than a function.

isaacbrodsky avatar Jul 07 '20 02:07 isaacbrodsky

I don't know which symbol is not exported. But you have to be aware that CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS (which is bad practice, this should only be a temporary workaround) can't export global variables: https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html#prop_tgt:WINDOWS_EXPORT_ALL_SYMBOLS

I would say generateFaceCenterPoint can't work if H3 is built as a shared lib because faceCenterGeo global variable is not exported (and shouldn't because it's not in public headers). These tests shouldn't work with shared lib, because they rely on private headers. By the way I don't realy understand why faceCenterGeo is a global variable, because it's only used internally in faceijk.c.

SpaceIm avatar Jul 07 '20 12:07 SpaceIm