# Question about CMAKE\_CXX\_ABI\_COMPILED Flag Variable

**URL:** https://discourse.cmake.org/t/question-about-cmake-cxx-abi-compiled-flag-variable/1976
**Category:** Usage
**Created:** [October 7, 2020, 12:55am UTC](https://discourse.cmake.org/t/question-about-cmake-cxx-abi-compiled-flag-variable/1976 "2020-10-07T00:55:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![marchani](https://discourse.cmake.org/user_avatar/discourse.cmake.org/marchani/32/857_2.png) [@marchani](https://discourse.cmake.org/u/marchani)
#### Post date: [October 7, 2020, 12:55am UTC](https://discourse.cmake.org/t/question-about-cmake-cxx-abi-compiled-flag-variable/1976/1 "2020-10-07T00:55:58Z")

</div>

I am attempting to cross-compile gRPC ([https://github.com/grpc/grpc](https://github.com/grpc/grpc)) from Windows to Linux as a third-party dependency using CMake and the Clang compiler, and I am also attempting to link to a pre-compiled version of `libc++`.

Here is what I believe is the relevant section of my toolchain file:

```auto
set(CMAKE_CXX_ABI_COMPILED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${LIBCXX_DIR}/include/c++/v1")
add_compile_options(--target=${triple} --sysroot=${CMAKE_SYSROOT})

add_link_options(-v --target=${triple} --sysroot=${CMAKE_SYSROOT} -L${LIBCXX_DIR}/lib/Linux/${triple})

```

If I execute this, then I am able to compile and link successfully; however, the following line does not seem like it should be necessary: `set(CMAKE_CXX_ABI_COMPILED ON)`. If I do not include this line in my toolchain file, then I get the following error:

```auto
-- Detecting CXX compiler ABI info - failed

```

Is it OK for me to set the `CMAKE_CXX_ABI_COMPILED` flag variable or am I masking an issue in my toolchain file? I am using cmake version 3.18.4.

Here is where I got the idea to implement this workaround in case it helps: [https://github.com/ruslo/polly/issues/152](https://github.com/ruslo/polly/issues/152).

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 24, 2020, 11:55pm UTC](https://discourse.cmake.org/t/question-about-cmake-cxx-abi-compiled-flag-variable/1976/2 "2020-11-24T23:55:52Z")

</div>

@brad.king

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 25, 2020, 12:06pm UTC](https://discourse.cmake.org/t/question-about-cmake-cxx-abi-compiled-flag-variable/1976/3 "2020-11-25T12:06:05Z")

</div>

`CMAKE_CXX_ABI_COMPILED` is an internal implementation detail that should not be set by projects. Don’t try to skip CMake’s toolchain initialization checks. They are important for CMake to detect things it needs to know to generate a proper buildsystem.

> Detecting CXX compiler ABI info - failed

There should be more information about that failure in the `CMakeFiles/CMakeError.log` file.
