# \#gen:ninja

**URL:** https://discourse.cmake.org/tag/gen-ninja/8.md?match_all_tags=true&page=2&tags%5B%5D=gen%3Aninja

[Latest](https://discourse.cmake.org/latest.md) · [Categories](https://discourse.cmake.org/categories.md) · [Tags](https://discourse.cmake.org/tags.md)

**Page:** 3

---

## [No SOURCES given to target: \_\_CMAKE\_\_CXX26 on ubuntu 25.04](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 17\
**Last updated:** [July 7, 2025, 6:41pm UTC](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240 "2025-07-07T18:41:16Z")

</div>

import std does also not work with gcc-15 on ubuntu 25.04! builder@5b11ff1f2350:~/workdir$ cmake -S . -B build -G Ninja --fresh -- The CXX compiler identification is GNU 15.0.1 -- Detecting CXX compiler ABI info -- Detec…

---

## [CXX\_MODULES: FAILED: CMakeFiles/Algo.dir/algo-impl.cpp.o.ddi](https://discourse.cmake.org/t/cxx-modules-failed-cmakefiles-algo-dir-algo-impl-cpp-o-ddi/14262)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 4\
**Last updated:** [July 4, 2025, 8:03pm UTC](https://discourse.cmake.org/t/cxx-modules-failed-cmakefiles-algo-dir-algo-impl-cpp-o-ddi/14262 "2025-07-04T20:03:44Z")

</div>

I have an import std; example based on C++20 Modules, CMake, And Shared Libraries It builds on CI windows (MS cl), ubuntu (gcc-15, gcc-16), but not with clang-20/21! @ben.boeckel But on my local iMac i368 (OSX) it bui…

---

## [Does anyone have experience compiling for HPE OSS?](https://discourse.cmake.org/t/does-anyone-have-experience-compiling-for-hpe-oss/14308)

<div class="topic-metadata">

**Author:** [@manray](https://discourse.cmake.org/u/manray)\
**Replies:** 0\
**Last updated:** [July 2, 2025, 1:48pm UTC](https://discourse.cmake.org/t/does-anyone-have-experience-compiling-for-hpe-oss/14308 "2025-07-02T13:48:37Z")

</div>

I am switching build systems from Meson/Ninja to CMake/Ninja for a large C/C++ project that targets many operating systems. AIX, Solaris, Linux, Windows, etc seem well supported by CMake, but I am worried about HPE OSS a…

---

## [Cross-compiling with ninja multi-config](https://discourse.cmake.org/t/cross-compiling-with-ninja-multi-config/14291)

<div class="topic-metadata">

**Author:** [@galax](https://discourse.cmake.org/u/galax)\
**Replies:** 3\
**Last updated:** [June 30, 2025, 1:52pm UTC](https://discourse.cmake.org/t/cross-compiling-with-ninja-multi-config/14291 "2025-06-30T13:52:34Z")

</div>

Hi All, I managed to cross compile with the ccrx v3.06 using ninja and cmake v4.0.2. I would like to go multi-config BUT a define (CMAKE\_INTDIR) is added under the hood. The problem is that the ccrx accepts defines as…

---

## [How to make a source file compile before any others within a target](https://discourse.cmake.org/t/how-to-make-a-source-file-compile-before-any-others-within-a-target/14231)

<div class="topic-metadata">

**Author:** [@huangqinjin](https://discourse.cmake.org/u/huangqinjin)\
**Replies:** 2\
**Last updated:** [June 29, 2025, 2:34pm UTC](https://discourse.cmake.org/t/how-to-make-a-source-file-compile-before-any-others-within-a-target/14231 "2025-06-29T14:34:55Z")

</div>

I have a target hello with two source files a.cpp and b.cpp. And both contain the #import directive: #import "C:\\Program Files\\Common Files\\System\\ado\\msado15.dll" no\_namespace rename("EOF", "EndOfFile") which will g…

---

## [Unexpected behavior when regenerating a project with Ninja Multi-Config and MSVC](https://discourse.cmake.org/t/unexpected-behavior-when-regenerating-a-project-with-ninja-multi-config-and-msvc/14099)

<div class="topic-metadata">

**Author:** [@aeart](https://discourse.cmake.org/u/aeart)\
**Replies:** 1\
**Last updated:** [June 19, 2025, 1:37am UTC](https://discourse.cmake.org/t/unexpected-behavior-when-regenerating-a-project-with-ninja-multi-config-and-msvc/14099 "2025-06-19T01:37:59Z")

</div>

I have encountered an unusual behavior when regenerating a project using Ninja Multi-Config as the generator and Microsoft Visual C++ (MSVC) as the compiler. Here is a minimal example project consisting of three files: …

---

## [Strange errors while build examples with CXX\_MODULEs on main branch](https://discourse.cmake.org/t/strange-errors-while-build-examples-with-cxx-modules-on-main-branch/14181)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 6\
**Last updated:** [June 7, 2025, 6:59pm UTC](https://discourse.cmake.org/t/strange-errors-while-build-examples-with-cxx-modules-on-main-branch/14181 "2025-06-07T18:59:59Z")

</div>

bash-5.2$ cd Tests/RunCMake/CXXModules/examples/import-std bash-5.2$ !CXX CXX=g++-15 cmake -S . -B build --fresh -D CMAKE\_CXX\_STANDARD\_LIBRARY=libstdc++ -- The CXX compiler identification is GNU 15.1.0 -- Checking whethe…

---

## [Cmake presets](https://discourse.cmake.org/t/cmake-presets/14118)

<div class="topic-metadata">

**Author:** [@madam\_smith](https://discourse.cmake.org/u/madam_smith)\
**Replies:** 0\
**Last updated:** [May 19, 2025, 2:28pm UTC](https://discourse.cmake.org/t/cmake-presets/14118 "2025-05-19T14:28:18Z")

</div>

I’m working with CMake Presets and want to conditionally enable presets based on whether a specific SDK folder exists on disk. For example, I have presets for building against different SDK versions, and I want the pres…

---

## [add\_subdirectory() for Git Submodules without CMakeLists.txt?](https://discourse.cmake.org/t/add-subdirectory-for-git-submodules-without-cmakelists-txt/14085)

<div class="topic-metadata">

**Author:** [@bmcdonnell-fb](https://discourse.cmake.org/u/bmcdonnell-fb)\
**Replies:** 7\
**Last updated:** [May 17, 2025, 8:26pm UTC](https://discourse.cmake.org/t/add-subdirectory-for-git-submodules-without-cmakelists-txt/14085 "2025-05-17T20:26:28Z")

</div>

I have a CMake project using the Ninja generator and GNU Arm Embedded Toolchain, with libraries in Git submodules. I’d like to be able to add the libraries using add\_subdirectory() or similar, with its scoping features, …

---

## [Method to build unit tests with separate toolchain](https://discourse.cmake.org/t/method-to-build-unit-tests-with-separate-toolchain/14097)

<div class="topic-metadata">

**Author:** [@DerekCresswell](https://discourse.cmake.org/u/DerekCresswell)\
**Replies:** 2\
**Last updated:** [May 15, 2025, 3:16pm UTC](https://discourse.cmake.org/t/method-to-build-unit-tests-with-separate-toolchain/14097 "2025-05-15T15:16:48Z")

</div>

Here’s a brief outline of my situation: I’m working on a large Windows Kernel Mode Driver Our unit tests need to run in user mode Our toolchain is setup to support user and kernel mode But we cannot unify the building …

---

## [gcc15 and cmake 4.0.1: errors at cross-building cmake](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048)

<div class="topic-metadata">

**Author:** [@Piotr\_Oniszczuk](https://discourse.cmake.org/u/Piotr_Oniszczuk)\
**Replies:** 4\
**Last updated:** [May 13, 2025, 6:52pm UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048 "2025-05-13T18:52:19Z")

</div>

Hi guys, I’m in upgrade process of gcc from 14.2.0 to 15.1.0 in my distros and have issue with cross-compiling cmake 4.0.1 for my toolchain. Cross-build erorr is like this: gist:d171eaf91b52dd999a2cf9019342d558 · GitHu…

---

## [Undefined Reference error using modules in C++23 with clang and cmake](https://discourse.cmake.org/t/undefined-reference-error-using-modules-in-c-23-with-clang-and-cmake/14045)

<div class="topic-metadata">

**Author:** [@saurabh](https://discourse.cmake.org/u/saurabh)\
**Replies:** 4\
**Last updated:** [May 7, 2025, 10:42pm UTC](https://discourse.cmake.org/t/undefined-reference-error-using-modules-in-c-23-with-clang-and-cmake/14045 "2025-05-07T22:42:51Z")

</div>

Hello, I’m getting started with C++23 modules and trying to use them in a personal project. The plan is to create an executable for the entire project, which would contain the output of all unit tests. Each source cpp …

---

## [How to control the MSVC CRT with cmake?](https://discourse.cmake.org/t/how-to-control-the-msvc-crt-with-cmake/13195)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 1\
**Last updated:** [April 25, 2025, 11:28am UTC](https://discourse.cmake.org/t/how-to-control-the-msvc-crt-with-cmake/13195 "2025-04-25T11:28:34Z")

</div>

I I need to use MSVC v140 toolchain and QT v8.8.7 with an old version of OpenSSL. Both does’t support to mix debug and release builds out of the box. Warning LNK2038: defaultlib '\*library\* ' conflicts with use of other…

---

## [Overriding Source File Properties Precedense Clarity](https://discourse.cmake.org/t/overriding-source-file-properties-precedense-clarity/13955)

<div class="topic-metadata">

**Author:** [@Drue\_Peters](https://discourse.cmake.org/u/Drue_Peters)\
**Replies:** 0\
**Last updated:** [April 17, 2025, 11:32pm UTC](https://discourse.cmake.org/t/overriding-source-file-properties-precedense-clarity/13955 "2025-04-17T23:32:06Z")

</div>

There are a few sections across our code base where it would be nice to always optimize specific files. I’m currently using set\_source\_files\_properties(src.cpp PROPERTIES COMPILE\_FLAGS "-O3") to enforce this. The ninja …

---

## [Add Build Dependency for Configuration Files Consumed by Code Generation Script](https://discourse.cmake.org/t/add-build-dependency-for-configuration-files-consumed-by-code-generation-script/10668)

<div class="topic-metadata">

**Author:** [@Drue\_Peters](https://discourse.cmake.org/u/Drue_Peters)\
**Replies:** 6\
**Last updated:** [April 17, 2025, 11:26pm UTC](https://discourse.cmake.org/t/add-build-dependency-for-configuration-files-consumed-by-code-generation-script/10668 "2025-04-17T23:26:25Z")

</div>

Hey, I’ve tried searching the forums and internet for this, but solutions I’ve tried haven’t worked. Our codebase uses a Python script that generates some final stages of C++. This Python script is called by using add…

---

## [cmake-gui blocks presets that are usable through command line cmake](https://discourse.cmake.org/t/cmake-gui-blocks-presets-that-are-usable-through-command-line-cmake/9459)

<div class="topic-metadata">

**Author:** [@AngelDev06](https://discourse.cmake.org/u/AngelDev06)\
**Replies:** 2\
**Last updated:** [March 12, 2025, 2:38pm UTC](https://discourse.cmake.org/t/cmake-gui-blocks-presets-that-are-usable-through-command-line-cmake/9459 "2025-03-12T14:38:48Z")

</div>

I have an issue specifically with cmake-gui. I have written a CMakePresets.json file to build my project on linux however as stated in the title even though running cmake --list-presets on command line displays all prese…

---

## [Compile options not being applied to modules](https://discourse.cmake.org/t/compile-options-not-being-applied-to-modules/13727)

<div class="topic-metadata">

**Author:** [@mmoult](https://discourse.cmake.org/u/mmoult)\
**Replies:** 0\
**Last updated:** [March 12, 2025, 1:55am UTC](https://discourse.cmake.org/t/compile-options-not-being-applied-to-modules/13727 "2025-03-12T01:55:09Z")

</div>

I believe that I have encountered a bug in CMake. I am using C++ modules, and target\_compile\_options or compile\_options are only being applied to the regular C++ files, not the module files (as observed through the compi…

---

## [Test C Compiler failing in Nix Shell because it can't find libclang\_rt](https://discourse.cmake.org/t/test-c-compiler-failing-in-nix-shell-because-it-cant-find-libclang-rt/10729)

<div class="topic-metadata">

**Author:** [@abalu](https://discourse.cmake.org/u/abalu)\
**Replies:** 1\
**Last updated:** [March 4, 2025, 9:03am UTC](https://discourse.cmake.org/t/test-c-compiler-failing-in-nix-shell-because-it-cant-find-libclang-rt/10729 "2025-03-04T09:03:04Z")

</div>

When I run cmake -GNinja I get the error /nix/store/vj57s3h2za2qrfccrvc9b6i7s8mw3ndn-binutils-2.41/bin/ld: cannot find /nix/store/r3cfvnc01wssfqhp5kg8725v94idkysy-clang-18.1.3/lib/clang/18/lib/linux/libclang\_rt.asan\_sta…

---

## [Compiler program installed in Windows cannot recognize file path generated by Cmake in Cygwin.](https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369)

<div class="topic-metadata">

**Author:** [@focusfeel](https://discourse.cmake.org/u/focusfeel)\
**Replies:** 2\
**Last updated:** [February 28, 2025, 5:53pm UTC](https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369 "2025-02-28T17:53:18Z")

</div>

Environment description: Cmake and Ninja installed in Cygwin Compiler program (like mingw-gcc) installed in Windows When I use cmake in cygwin to build a project, it will go error when running try-compile project for …

---

## [Linkin an imported library](https://discourse.cmake.org/t/linkin-an-imported-library/13636)

<div class="topic-metadata">

**Author:** [@noahdav](https://discourse.cmake.org/u/noahdav)\
**Replies:** 1\
**Last updated:** [February 26, 2025, 4:50pm UTC](https://discourse.cmake.org/t/linkin-an-imported-library/13636 "2025-02-26T16:50:09Z")

</div>

Hi, Let me start off by saying that I have some 3ed party code that I do not want to modify if possible. We are trying to move to use the Ninja generators from visual studio generators. I have ran into a problem with …

---

## [Running target from post build](https://discourse.cmake.org/t/running-target-from-post-build/13624)

<div class="topic-metadata">

**Author:** [@noahdav](https://discourse.cmake.org/u/noahdav)\
**Replies:** 4\
**Last updated:** [February 26, 2025, 12:25pm UTC](https://discourse.cmake.org/t/running-target-from-post-build/13624 "2025-02-26T12:25:53Z")

</div>

Hi, I am trying to get a project to invoke a target after the build completes. I do not want a separate target but instead the target should be invoked after the build completes (compile and link). In my case we do so…

---

## [How to build NVidia binaries using CMake's new HIP language?](https://discourse.cmake.org/t/how-to-build-nvidia-binaries-using-cmakes-new-hip-language/4208)

<div class="topic-metadata">

**Author:** [@krasznaa](https://discourse.cmake.org/u/krasznaa)\
**Replies:** 7\
**Last updated:** [February 3, 2025, 10:05am UTC](https://discourse.cmake.org/t/how-to-build-nvidia-binaries-using-cmakes-new-hip-language/4208 "2025-02-03T10:05:06Z")

</div>

I’ve updated my code recently to make use of the “HIP language”, introduced in 3.21. After some initial success on a host with an AMD card, I was now trying to build some code on a host that has an NVidia card. And had …

---

## [CMake Error : Cannot find source file -\> No SOURCES given to target](https://discourse.cmake.org/t/cmake-error-cannot-find-source-file-no-sources-given-to-target/9650)

<div class="topic-metadata">

**Author:** [@Raphy](https://discourse.cmake.org/u/Raphy)\
**Replies:** 7\
**Last updated:** [January 29, 2025, 3:53pm UTC](https://discourse.cmake.org/t/cmake-error-cannot-find-source-file-no-sources-given-to-target/9650 "2025-01-29T15:53:37Z")

</div>

With this CMakeLists.txt file: cmake\_minimum\_required(VERSION 3.24) project(my\_application LANGUAGES CXX) include(FetchContent) FetchContent\_Declare( WebKit2 #URL https://webkitgtk.org/releases/webkitgtk-2.42.3.tar…

---

## [Reading all lines of a file can not deal with "\[" character](https://discourse.cmake.org/t/reading-all-lines-of-a-file-can-not-deal-with-character/13397)

<div class="topic-metadata">

**Author:** [@Gornhoth](https://discourse.cmake.org/u/Gornhoth)\
**Replies:** 4\
**Last updated:** [January 15, 2025, 7:03pm UTC](https://discourse.cmake.org/t/reading-all-lines-of-a-file-can-not-deal-with-character/13397 "2025-01-15T19:03:21Z")

</div>

Hello, can anybody please help me figure out what is going wrong with how i try to read all lines of a file. I have the following input file which i want to have line by line: ExampleText\[\]; SecondExampleText; \[ Another…

---

## [Can Ninja replace Unix makefiles ?](https://discourse.cmake.org/t/can-ninja-replace-unix-makefiles/13388)

<div class="topic-metadata">

**Author:** [@Laur59](https://discourse.cmake.org/u/Laur59)\
**Replies:** 10\
**Last updated:** [January 14, 2025, 3:44am UTC](https://discourse.cmake.org/t/can-ninja-replace-unix-makefiles/13388 "2025-01-14T03:44:04Z")

</div>

Hello I use so far Unix makefiles as generator in projects. The typical building process is to go project directory and rm -r build cmake -S . -B build cmake --build build I wished to experiment with ninja thus I trie…

---

## [how to config cmake file correctly for header file change detection (Tasking C compiler + Ninja)](https://discourse.cmake.org/t/how-to-config-cmake-file-correctly-for-header-file-change-detection-tasking-c-compiler-ninja/13372)

<div class="topic-metadata">

**Author:** [@Siwei\_Xia](https://discourse.cmake.org/u/Siwei_Xia)\
**Replies:** 3\
**Last updated:** [January 11, 2025, 10:33pm UTC](https://discourse.cmake.org/t/how-to-config-cmake-file-correctly-for-header-file-change-detection-tasking-c-compiler-ninja/13372 "2025-01-11T22:33:10Z")

</div>

I am using cmake + ninja + Tasking C compiler to build an Infineon Aurix TC3xx project for instance: add\_executable(“${sw\_product}” ${project\_source}) the “project\_source” contain all the necessary .c files for the pr…

---

## [Cpack multi config packaging overwrites the binaries](https://discourse.cmake.org/t/cpack-multi-config-packaging-overwrites-the-binaries/13344)

<div class="topic-metadata">

**Author:** [@Alaa\_Mahran](https://discourse.cmake.org/u/Alaa_Mahran)\
**Replies:** 2\
**Last updated:** [January 9, 2025, 11:08am UTC](https://discourse.cmake.org/t/cpack-multi-config-packaging-overwrites-the-binaries/13344 "2025-01-09T11:08:25Z")

</div>

I’m using ninja multi configuration to configure my project and building both debug and release versions of the embedded software When using Cpack to package both configurations, I end up with only one set of binaries, …

---

## [ExternalProject\_Add commands with wildcard](https://discourse.cmake.org/t/externalproject-add-commands-with-wildcard/13289)

<div class="topic-metadata">

**Author:** [@DKLind](https://discourse.cmake.org/u/DKLind)\
**Replies:** 5\
**Last updated:** [January 7, 2025, 2:32pm UTC](https://discourse.cmake.org/t/externalproject-add-commands-with-wildcard/13289 "2025-01-07T14:32:03Z")

</div>

I have a little problem with ExternalProject\_Add when I try to use a command with a wildcard ‘\*’. The command statement is generated with quotes around the wildcard statement which causes the command to fail. For exampl…

---

## [Ninja always rebuilds an internal target causing issues on target](https://discourse.cmake.org/t/ninja-always-rebuilds-an-internal-target-causing-issues-on-target/13327)

<div class="topic-metadata">

**Author:** [@christophe-calmejane](https://discourse.cmake.org/u/christophe-calmejane)\
**Replies:** 0\
**Last updated:** [January 3, 2025, 2:11pm UTC](https://discourse.cmake.org/t/ninja-always-rebuilds-an-internal-target-causing-issues-on-target/13327 "2025-01-03T14:11:27Z")

</div>

Here is a sample project: cmake\_minimum\_required(VERSION 3.30) project(myLib) add\_library(${PROJECT\_NAME} SHARED myLib.cpp) set\_target\_properties(${PROJECT\_NAME} PROPERTIES VERSION "1.2.3.4" SOVERSION "1") add\_custom…

---

## [error: module file CMakeFiles/\_\_cmake\_cxx23.dir/std.pcm cannot be loaded due to a configuration mismatch with the current compilation](https://discourse.cmake.org/t/error-module-file-cmakefiles-cmake-cxx23-dir-std-pcm-cannot-be-loaded-due-to-a-configuration-mismatch-with-the-current-compilation/13276)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 6\
**Last updated:** [January 3, 2025, 8:50am UTC](https://discourse.cmake.org/t/error-module-file-cmakefiles-cmake-cxx23-dir-std-pcm-cannot-be-loaded-due-to-a-configuration-mismatch-with-the-current-compilation/13276 "2025-01-03T08:50:21Z")

</div>

I am trying to use an exported CXX\_MODULE builded and tested according https://www.kitware.com/import-std-in-cmake-3-30/ \[9/10\] Install the project... -- Install configuration: "Debug" -- Installing: /Users/clausklein/W…

[Previous page](https://discourse.cmake.org/tag/gen-ninja/8.md?match_all_tags=true&page=1&tags%5B%5D=gen%3Aninja)

[Next page](https://discourse.cmake.org/tag/gen-ninja/8.md?match_all_tags=true&page=3&tags%5B%5D=gen%3Aninja)
