msvc.patch 588 B

123456789101112131415
  1. diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
  2. --- a/utils/CMakeLists.txt
  3. +++ b/utils/CMakeLists.txt
  4. @@ -1,5 +1,10 @@
  5. add_executable(zfpcmd zfp.c)
  6. -set_property(TARGET zfpcmd PROPERTY OUTPUT_NAME zfp)
  7. +
  8. +# protect against LNK1114: cannot overwrite the original file 'lib/Release/zfp.lib'; error code 32;
  9. +# rationale: linker can't handle the case of an executable file having the same name as a library file
  10. +if(NOT MSVC)
  11. + set_property(TARGET zfpcmd PROPERTY OUTPUT_NAME zfp)
  12. +endif()
  13. target_link_libraries(zfpcmd zfp)
  14. if(HAVE_LIBM_MATH)
  15. target_link_libraries(zfpcmd m)