Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: oBFusCATed on March 19, 2014, 10:51:38 pm

Title: clang pch support
Post by: oBFusCATed on March 19, 2014, 10:51:38 pm
What should be done to add support for it?
I've tried to build C::B's project on linux using the clang compiler and the pch is not generated.
Title: Re: clang pch support
Post by: stahta01 on March 19, 2014, 10:54:30 pm
What should be done to add support for it?
I've tried to build C::B's project on linux using the clang compiler and the pch is not generated.

Edit the file properties of sdk.h and sdk_precomp.h should do it.
Might only need to edit one under Linux.

How to edit will be based on the command to create PCH using clang compiler.

Tim S.
Title: Re: clang pch support
Post by: oBFusCATed on March 19, 2014, 11:13:33 pm
It should just work, but it doesn't, my question is what should be done to add support for the magick...
Title: Re: clang pch support
Post by: stahta01 on March 19, 2014, 11:20:48 pm
It should just work, but it doesn't, my question is what should be done to add support for the magick...

Have to do some major work in the CBP to add PCH for clang.

http://clang.llvm.org/docs/UsersManual.html#precompiled-headers (http://clang.llvm.org/docs/UsersManual.html#precompiled-headers)

I am thinking "Relocatable PCH Files" will require less changes to the CB cbp and source files.

But, I am thinking the "-include" will be easier to maintain if the CB Dev team decides to change the GCC Compiler to use the same method.
The "-include" method requires all the including of the sdk.h in source files to be removed (or guards added); at least it does on Windows using MinGW GCC.

Example of what is meant by guards.
Code
Index: src/src/examinememorydlg.cpp
===================================================================
--- src/src/examinememorydlg.cpp (revision 9742)
+++ src/src/examinememorydlg.cpp (working copy)
@@ -7,7 +7,9 @@
  * $HeadURL$
  */
 
-#include "sdk.h"
+#ifndef SDK_H
+    #include <sdk.h>
+#endif
 
 #ifndef CB_PRECOMP
     #include <wx/button.h>


Tim S.
Title: Re: clang pch support
Post by: oBFusCATed on March 20, 2014, 08:38:55 am
Hm, does C::B support precompiled headers for VC? Can someone on windows test it?
Title: Re: clang pch support
Post by: stahta01 on March 20, 2014, 03:36:01 pm
Hm, does C::B support precompiled headers for VC? Can someone on windows test it?

No, it does NOT support automatically precompiled headers for VC.

I based this on CB (svn 9673) ignoring the "compile" check-mark in header file properties.

Tim S.