Skip to content
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

cpp 17 / std::filesystem wip #6844

Merged
merged 62 commits into from Mar 10, 2022
Merged

Conversation

ofTheo
Copy link
Member

@ofTheo ofTheo commented Jan 21, 2022

This PR is for addressing the last things from #6585

The code changes needed for OF are all done from previous PRs.
This PR is to simplify the process of enabling cpp 17 ( or newer ) for a project.

One common theme is that we need to both set the cpp version to c++17 but also define OF_USING_STD_FS=1.
I am wondering maybe could we just detect c++17 in ofConstants.h and auto enable OF_USING_STD_FS if not defined

Edit: going with auto detect as it makes everything cleaner.

Status:

@ofTheo ofTheo added this to the 0.12.0 milestone Jan 21, 2022
@dimitre
Copy link
Member

dimitre commented Jan 24, 2022

Great work @ofTheo ! What do you think we could use to opt for different Project.xcconfig versions?
Maybe something in project generator or a duplicate template for osx?

@ofTheo
Copy link
Member Author

ofTheo commented Jan 24, 2022

Yeah I think maybe the default could be C++17 and then using the PG template system for macOS 10.14 which can't handle C++17 - that should be fairly easy.

I don't think there are other platforms which couldn't just be C++17 going forward ( will see as we get the rest of the platforms in this PR ).

@arturoc
Copy link
Member

arturoc commented Jan 24, 2022

I think most platforms should support c++17 without problem. I would even remove boost at some point once we deprecate whatever version of macos is the latest that doesn't support c++17. boost was always a temporary thing to get rid of poco until there was support for std::fs

@ofTheo
Copy link
Member Author

ofTheo commented Jan 24, 2022

@arturoc great! sounds good.
Yeah, I think we could probably keep boost for one more release and then remove.
macOS 10.14 is now 4 versions behind, so maybe even by the time we get to the next release it could be safe to remove :)

@ofTheo
Copy link
Member Author

ofTheo commented Feb 18, 2022

Thanks @danoli3!
I think it can work without recompiling libs.
At least managed to do so for most platforms so far - now just trying to get all the platform changes in without breaking others. :P

@ofTheo
Copy link
Member Author

ofTheo commented Feb 18, 2022

seems to be working now!
going to look at android and arm next ( had to disable armv7 as there were some unrelated issues )

@chilina
Copy link

chilina commented Feb 26, 2022

Hey Theo (and others) thank you so much for working on this! I'm always in awe of how the development team keeps oF current and relevant on so many different platforms. Looking forward to using the TBB library on macOS with c++17. I'd help if my skills were better; I'd be completely lost trying to do this. So many many thanks and excited to see these kinds of projects in process!

@ofTheo ofTheo mentioned this pull request Mar 2, 2022
77 tasks
@ofTheo
Copy link
Member Author

ofTheo commented Mar 4, 2022

@chilina you're welcome - thanks for the note!
Hoping to get this finished and merged in soon so people can test with the nightly builds.

@ofTheo
Copy link
Member Author

ofTheo commented Mar 8, 2022

So looks like Android will have to wait till the NDK update from @danoli3
( see error message at bottom )

Everything else is working just need to clean it up a bit and do a couple more tests.

error: invalid value 'c++17' in '-std=c++17'
note: use 'c++98' for 'ISO C++ 1998 with amendments' standard
note: use 'c++03' for 'ISO C++ 1998 with amendments' standard
note: use 'gnu++98' for 'ISO C++ 1998 with amendments and GNU extensions' standard
note: use 'c++0x' for 'ISO C++ 2011 with amendments' standard
note: use 'c++11' for 'ISO C++ 2011 with amendments' standard
note: use 'gnu++0x' for 'ISO C++ 2011 with amendments and GNU extensions' standard
note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard
note: use 'c++1y' for 'ISO C++ 2014 with amendments' standard
note: use 'c++14' for 'ISO C++ 2014 with amendments' standard
note: use 'gnu++1y' for 'ISO C++ 2014 with amendments and GNU extensions' standard
note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard
note: use 'c++1z' for 'Working draft for ISO C++ 2017' standard
note: use 'gnu++1z' for 'Working draft for ISO C++ 2017 with GNU extensions' standard
note: use 'cuda' for 'NVIDIA CUDA(tm)' standard

@ofTheo ofTheo merged commit fab4482 into openframeworks:master Mar 10, 2022
@stungeye
Copy link

I've tested cpp17 and std::filesystem in the night build with Visual Studio 2022. Works great! Results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants