-
Notifications
You must be signed in to change notification settings - Fork 955
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
CMake support for shared library and Visual Studio 2019 #2133
Conversation
…:experimental::filesystem). Excluded AntTweakBar and ci::params from compilation.
…ed support for Visual Studio 2019.
This reverts commit 5a83507.
Why is |
Visual Studio 2019 defaults to C++14, so I wanted to allow people to opt for C++17 instead. Most of the "machinery" was already in the make files, but I guess using |
Personally I think you could plain remove everything from line 89 to 134. It is essentially just duplicating existing cmake functionality. But I haven't checked myself if those heads any bad sideeffect. |
Yes, because VS2015 doesn't have different language modes in the first place. |
Btw. I believe that _HAS_CXX17 is a STL-internal macro that should not be used in user code. I haven't checked, when this was introduced, but for conditionally enabling std::filesystem, the standard featur test macro |
Thanks, Mike. Seems I still have a lot to learn. |
Mostly minor stuff I'd say. I also just realized that the scrip claims compatibility with cmake 2.9 (I wonder if anyone is actually verifying this - 2.9 was realeased around 2010 ) which I believe didn't have Anyway, I think a cmake overhaul has to wait until after 9.3 got released, but I'd very much appreciate if this PR would find its way into 9.3. [EDIT: that was supposed to mean 9.2] |
I have used cinder on linux without any issue. Thanks to this PR, I can compile cinder with C++17, but still not C++20, because It is a pain to keep supporting every C++ standard. So, I think that, since C++14 is quite old now, there could be a last release supporting it, before dropping C++14 support for future releases, in favor of C++17 and C++20. It would make cinder only fresher and more attractive. |
Could you open an issue about the c++20 breakage - ideally with the error message and or line, where result_of is used? |
Let me provide more detail. With GCC 10.2 on linux, I can compile with C++20. It seems to have kept backward compatibility, despite the C++20 standard not requiring it. You can check here (godefv@f33b943) what I have done to successfully compile with C++20. This commit is on top of this PR. EDIT: I have put this comment in a new issue as you have asked. |
This PR adds support for building Cinder as a shared library using the CMake system. It also adds support for Visual Studio 2019.
See also the discussion around PR #2117 . My PR also removes the forced
/MT
setting and can therefore be used instead of #2117.The CMake files for Windows were missing the following files in the DLL build:
videoInput/videoInput.cpp
The following files were specifically excluded from the DLL build:
cinder/ImageSourcePng.cpp
cinder/app/AppScreenSaver.cpp
cinder/app/msw/AppInplMswScreenSaver.cpp
The following libraries were added as dependencies in the DLL build:
kernel32.lib
,user32.lib
,gdi32.lib
,winspool.lib
,comdlg32.lib
,advapi32.lib
,shell32.lib
,ole32.lib
,oleaut32.lib
,uuid.lib
,odbc32.lib
,odbccp32.lib
A build option was added:
CINDER_ENABLE_CXX17
(defaults to OFF). Setting this to ON will attempt to build Cinder using the C++17 language. For Visual Studio 2019, this means it will use the proper<filesystem>
header, instead of<experimental/filesystem>
.Important! This PR has only been tested on Windows. Before accepting it, please make sure it does not break building on the other platforms!