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

problems using cmake target on macos #40

Open
pbrady opened this issue Jan 29, 2022 · 1 comment
Open

problems using cmake target on macos #40

pbrady opened this issue Jan 29, 2022 · 1 comment

Comments

@pbrady
Copy link

pbrady commented Jan 29, 2022

Using apple-clang@13, I can successfully build, install, and run the tests via ctest. The cmake modules detect that apple-clang needed the -fcoroutines-ts flag and everything succeeds. But for some reason, when consuming cppcoro from another cmake project, I get the following error:

CMake Error at /Users/ptb/gitrepos/cppcoro/install/lib/cmake/cppcoro/FindCoroutines.cmake:281 (message):
  Cannot compile simple program using std::coroutines.  Is C++17 or later
  activated?
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.22.1/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /Users/ptb/gitrepos/cppcoro/install/lib/cmake/cppcoro/cppcoroConfig.cmake:4 (find_dependency)
  CMakeLists.txt:28 (find_package)

The project does specify c++20 and CMakeOutput.log records the success before failing with the above message:

Performing C++ SOURCE FILE Test _CXX_COROUTINES_SUPPORTS_TS_FLAG succeeded with the following output:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -D_CXX_COROUTINES_SUPPORTS_TS_FLAG  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6   -fcoroutines-ts -std=c++2a -MD -MT CMakeFiles/cmTC_ca8c4.dir/src.cxx.o -MF CMakeFiles/cmTC_ca8c4.dir/src.cxx.o.d -o CMakeFiles/cmTC_ca8c4.dir/src.cxx.o -c /Users/ptb/gitrepos/raytracing/build/CMakeFiles/CMakeTmp/src.cxx

It seems like the successful detection is not percolating up.

@pbrady
Copy link
Author

pbrady commented Jan 30, 2022

PR #34 fixes this issue.

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

No branches or pull requests

1 participant