• 🎉 Hey there! I've just launched my brand new server voting platform — Metin2 P Servers 🚀

Faster Compilation with CCache on FreeBSD

Metin2Hub New World
Co-Admin
Aug
Threads
104
1,644
1
1,872
113
Papua New Guinea

AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!

Installation and Makefile Configuration​


Repeated compilation in large projects can significantly slow down development. When working on actively maintained or frequently updated projects, reducing build time becomes highly valuable. ccache helps solve this problem by caching previously compiled objects and reusing them when the same compilation is triggered again.

🔧 Installation​


The installation process is straightforward. Connect to your FreeBSD build server and run the following command:



Hidden content
You need to reply to this thread in order to see this content.

This will install ccache and make it ready for use on your system.

🛠 Makefile Configuration​


1771530824303.png

After installation, a small modification is required in your project’s Makefile files.


Locate the compiler definition (such as gcc or clang) and simply prepend ccache to it.


Example:



C++:
CC = gcc


should be changed to:



C++:
CC = ccache gcc


Or if you are calling the compiler directly:



C++:
ccache gcc main.c -o main


No additional configuration is required.


⚠️ Important: Make sure to apply this change to all Makefile files within your project. Otherwise, some components may not benefit from caching.

🚀 Benefits​

  • Significant time savings on repeated builds​
  • Faster development and testing cycles​
  • More efficient use of server resources​
  • Noticeable performance improvement in large-scale projects​

For actively developed environments, integrating ccache is a simple yet powerful optimization that improves workflow efficiency substantially.​
 
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock