# No SOURCES given to target: \_\_CMAKE\_\_CXX26 on ubuntu 25.04

**URL:** https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240
**Category:** Development
**Tags:** os:linux, gen:ninja
**Created:** [June 16, 2025, 11:26am UTC](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240 "2025-06-16T11:26:10Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [June 17, 2025, 5:10am UTC](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240/11 "2025-06-17T05:10:58Z")

</div>

But the `CMAKE_CXX_STANDARD_LIBRARY` is set in `CMakeDetermineComilerId.cmake`:

```cmake
  set(CMAKE_${lang}_STANDARD_LIBRARY "")
  if ("x${lang}" STREQUAL "xCXX" AND
      EXISTS "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${lang}-DetectStdlib.h" AND
      ("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xClang" AND
       "x${CMAKE_${lang}_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") OR
      ("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xGNU"))
    # See #20851 for a proper abstraction for this.
    execute_process(
      COMMAND "${CMAKE_${lang}_COMPILER}"
        ${CMAKE_${lang}_COMPILER_ID_ARG1}
        ${CMAKE_CXX_COMPILER_ID_FLAGS_LIST}
        -E
        -x c++-header
        "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${lang}-DetectStdlib.h"
        -o - # Write to stdout.
      OUTPUT_VARIABLE _lang_stdlib_out
      ERROR_VARIABLE _lang_stdlib_err
      RESULT_VARIABLE _lang_stdlib_res
      ERROR_STRIP_TRAILING_WHITESPACE)
    if (_lang_stdlib_res EQUAL 0)
      string(REGEX REPLACE ".*CMAKE-STDLIB-DETECT: (.+)\n.*" "\\1" "CMAKE_${lang}_STANDARD_LIBRARY" "${_lang_stdlib_out}")
    endif ()
  endif ()

```

default set to:  
**Modules/CMakeDetermineCompilerId.cmake(434): set(CMAKE\_CXX\_STANDARD\_LIBRARY libstdc++ PARENT\_SCOPE )**

But this helps:

```bash
CXX=clang++-20 CXXFLAGS=-stdlib=libc++ cmake -G Ninja -S . -B build --trace-expand --trace-source=CMakeDetermineCompilerId.cmake --fresh

```

---

_[View the full topic](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240)._
