New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual Studio 2010, 2012, 2013, and "14" compile fix #300
Visual Studio 2010, 2012, 2013, and "14" compile fix #300
Conversation
# target_link_libraries(OpenColorIO_STATIC | ||
# debug ${EXTERNAL_DEBUG_LIBRARIES} | ||
# optimized ${EXTERNAL_OPTIMIZED_LIBRARIES} | ||
# general ${EXTERNAL_GENERAL_LIBRARIES}) | ||
else() | ||
target_link_libraries(OpenColorIO_STATIC ${EXTERNAL_GENERAL_LIBRARIES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be removed too. See the comment in the pull request.
This breaks building on OS X for me, specifically the changes to
|
dbr, thanks for the feedback! Your findings are both unfortunate and strange since it builds on OSX 10.8 for me. :/ I use clang with -std=c++11 and -stdlib=libc++ so maybe that is the difference. Anyways, I can't really see what the problem could be from the linker errors you posted. Are you sure they are related to the changes in OpenColorABI.h and not to the CMake files? I.e., does it compile and link with the old OpenColorABI.h? If you are using clang you might want to try the last commit. |
Quite right. It's a combination of the two (I was removing diff-chunks in reverse order, which was confused matters) Specifically: It's interesting it worked fine for you - maybe clang or the newer Regardless, the fix is easy - remove the
With that changed, all builds on OS X perfectly for me
Huh, that's a good point. Perhaps we should remove the Nitpick: should remove the commented out |
I've been replying to the ocio-dev list instead of here so I'll cut-n-paste my findings for linux: The following change is causing a problem for linux:
I'm not exactly sure what the last part does except for include unistd.h twice if clang is defined. I get the following error building for Fedora x86_64 with this patch applied:
But I get a good build with that one hunk removed. The following links compare the package and abi differences with and without the patch: pkgdiff: abi-compliance-checker: |
- Fixed when the OCIO_BUILD_STATIC flag gets defined so that OCIO also builds on OSX with a non-clang compiler. - I accidentally included <unistd.h> for all builds in PathUtils.cpp because of copy-paste errors. This should now be fixed.
Thanks for the input from both of you! :) @dbr I've moved the OCIO_BUILD_STATIC flag like you suggest. Also, the commented-out lines have been removed along with the non-win32 target_link_libraries. Like you say it is harmless to use target_link_libraries on static library targets but it might confuse people (like me). It does have one good use: If you link the target (I.e., OpenColorIO_STATIC) to a runtime binary then the dependencies of the former are given to the latter. Since you don't do this, it should be harmless to remove the lines. @hobbes1069 Nice find! It was a copy-paste error. ;) It should be fixed now so that <unistd.h> is only included when clang is defined. I hope that is it but otherwise please report back! |
…to the compile flags
That last update for the includes fixed it for me. |
- Fixed when the OCIO_BUILD_STATIC flag gets defined so that OCIO also builds on OSX with a non-clang compiler. - I accidentally included <unistd.h> for all builds in PathUtils.cpp because of copy-paste errors. This should now be fixed.
…to the compile flags
…alund/OpenColorIO into visual-studio-2010-compile-fix
James Burgess made me aware of the fact that Little CMS (lcms) wouldn't build in the default Windows environment. You can now use the option USE_EXTERNAL_LCMS to point CMake to an externally built lcms library. Notice that USE_EXTERNAL_LCMS was already present previously but didn't have any effect. I don't know why, I didn't put it there). |
…to visual-studio-2010-compile-fix
…ent dependencies (CMake policy CMP0046). Added a missing include directive. Added boost dependency to build configuration for yaml-cpp versions 5.0.0 and greater. OCIO now compiles using Visual Studio "14" CTP3.
This patch also fixes compilation for Visual Studio "14" CTP 3 on Windows 8.1 since the latest commit (acc3735). Consequently, compilation also works for Visual Studio 2013 (and even the Visual Studio 2013 November CTP). |
Hi there, I'm interested in applying any patches that improve support on windows, but could I ask you to rebase your changes onto the latest master and squash your commits down to give a relevant history (eg, no upstream pull, or merges)? Just so I can clearly see what changes we are applying, and perhaps avoid any breakages on other platforms. Cheers, |
I changed the CMake files to fix the compilation issues I (and apparently others) had while trying to compile OpenColorIO on Windows 7 using Visual Studio 2010. This works for the STATIC version of OpenColorIO. I have not tried the SHARED version. Also, I only built the core OpenColorIO library and not any of the tools.
Notable changes: