elalish / manifold

Geometry library for topological robustness
Apache License 2.0
841 stars 91 forks source link

errors when compiling for iOS #944

Open wtholliday opened 1 day ago

wtholliday commented 1 day ago

I'm trying to compile manifold as an xcframework for iOS.

Doing this:

cmake -B build_ios -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64
cmake --build build_ios --config Release

(I'm using this toolchain file https://github.com/leetal/ios-cmake)

I get various errors like:

manifold/src/collider/include/manifold/collider.h:287:39: error: implicit conversion loses integer
      precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]

Probably can silence those warnings (though I'm lousy with CMake and -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF didn't do anything), but might be good to fix the underlying thing.

elalish commented 1 day ago

Yeah, some of that is actually in process now. But we have a fair number of those warnings silenced already as they can get pretty pedantic.

pca006132 commented 19 hours ago

Probably need -DCMAKE_CXX_FLAGS="-Wno-shorten-64-to-32".

pca006132 commented 19 hours ago

I had a look at this, there are simply too many changes required, and we have to change the internal halfedges to 64-bit which can affect performance and require further evaluation. I think for now the only way is to silence the warning.

wtholliday commented 16 hours ago

@pca006132 what about adding casts in the code? Also that particular warning above can be fixed by changing the int to a size_t it seems.

pca006132 commented 16 hours ago

This requires a lot of changes. For each one it is simple, but there are many of them...