ukoethe / vigra

a generic C++ library for image analysis
http://ukoethe.github.io/vigra/
Other
407 stars 191 forks source link

Fix C++ version detection for WebAssembly. #473

Open attilaolah opened 4 years ago

attilaolah commented 4 years ago

The Emscripten compiler (em++) will refuse to output the results of the buffer unless they are flushed explicitly, or implicitly with the std::endl. This will result in the C++ version being detected as being the literal string:

stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.

hmeine commented 4 years ago

This change causes a problem on my macOS system:

CMake Error at test/multiarray/CMakeLists.txt:17 (message):
  cmake error: VIGRA_CPP_VERSION not defined yet.  Call
  VIGRA_DETECT_CPP_VERSION() from the main CMakeLists file.

Do you see why?

attilaolah commented 4 years ago

Hmm, I don't see why, maybe the endl is actually causing problems, and we'd need to flush the buffer explicitly. I'll try that.