Author Topic: clang pch support  (Read 8099 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
clang pch support
« 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Online stahta01

  • Lives here!
  • ****
  • Posts: 7789
    • My Best Post
Re: clang pch support
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: clang pch support
« Reply #2 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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Online stahta01

  • Lives here!
  • ****
  • Posts: 7789
    • My Best Post
Re: clang pch support
« Reply #3 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

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.
« Last Edit: March 20, 2014, 12:51:55 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: clang pch support
« Reply #4 on: March 20, 2014, 08:38:55 am »
Hm, does C::B support precompiled headers for VC? Can someone on windows test it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Online stahta01

  • Lives here!
  • ****
  • Posts: 7789
    • My Best Post
Re: clang pch support
« Reply #5 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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org