[DiscordArchive] I've been working on some changes to an existing C++ module. Is there a way to speed up compiling of
[DiscordArchive] I've been working on some changes to an existing C++ module. Is there a way to speed up compiling of
Archived author: kastang • Posted: 2025-10-19T18:50:17.217000+00:00
Original source
I've been working on some changes to an existing C++ module. Is there a way to speed up compiling of the module to test changes other than compiling AC entirely each time?
Archived author: Takenbacon • Posted: 2025-10-19T18:51:30.715000+00:00
Original source
Are you hitting rebuild all rather than build? Modifying a module shouldn't be compiling everything else
Archived author: kastang • Posted: 2025-10-19T18:53:45.411000+00:00
Original source
I'm deleting the build/ folder and running this:
```
cd "$CORE_BUILD"
cmake ../src \
-DCMAKE_INSTALL_PREFIX=/core/server/ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DWITH_WARNINGS=1 \
-DTOOLS_BUILD=all \
-DSCRIPTS=static \
-DMODULES=static \
make -j"$(nproc --ignore=1)"
make install
```
Thats a snippet from an automated build process I have
Archived author: Bench • Posted: 2025-10-19T18:54:14.023000+00:00
Original source
Yea you're rebuilding the whole thing rather than just the changed code
Archived author: kastang • Posted: 2025-10-19T18:54:45.464000+00:00
Original source
Ah - So I don't need to delete the build/ folder? I thought it gave me an error that the build/ folder was present when I tried not removing it before. Let me try again.
Archived author: Takenbacon • Posted: 2025-10-19T18:58:53.642000+00:00
Original source
you only really need to run cmake if files are added/removed
Archived author: Takenbacon • Posted: 2025-10-19T18:59:14.373000+00:00
Original source
if you're just modifying code, you _only_ need to run make -j xxx install
Archived author: kastang • Posted: 2025-10-19T18:59:59.663000+00:00
Original source
Oh! Thank you so much. That will save a bunch of time.
Archived author: kastang • Posted: 2025-10-19T19:10:39.703000+00:00
Original source
Oof. The hours wasted waiting for things to compile . Works perfectly thank you again!