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

chat(build): add conftest for std::optional::transform #2952

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

cebtenzzre
Copy link
Member

This will prevent users from wasting time waiting for GPT4All to compile if their compiler does not support std::optional::transform, which we require. Success looks like this:

-- Checking for __cpp_lib_optional >= 202110L
-- Checking for __cpp_lib_optional >= 202110L - pass

Failure looks like this:

$ cmake -B build -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
-- The CXX compiler identification is GNU 11.3.0
-- The C compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-11 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking for __cpp_lib_optional >= 202110L
-- Checking for __cpp_lib_optional >= 202110L - fail
CMake Error at CMakeLists.txt:46 (message):
  The C++ compiler

    "/usr/bin/g++-11"

  is too old to support __cpp_lib_optional >= 202110L.

  Please specify a newer compiler via
  -DCMAKE_C_COMPILER/-DCMAKE_CXX_COMPILER.
Call Stack (most recent call first):
  CMakeLists.txt:56 (check_cpp_feature)


-- Configuring incomplete, errors occurred!

This check is as generic as possible so we can easily add/remove features from this list.

MSVC does not support #elifdef yet.

Signed-off-by: Jared Van Bortel <[email protected]>
@cebtenzzre cebtenzzre merged commit 2528675 into main Sep 11, 2024
4 of 10 checks passed
@cebtenzzre cebtenzzre deleted the conftest-monadic-optional branch September 11, 2024 18:59
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.

2 participants