Skip to content

problems using cmake target on macosΒ #40

@pbrady

Description

@pbrady

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions