Author Topic: Using Clang (7.0) on Windows to Build Code::Blocks for Windows  (Read 9088 times)

smallscript

  • Guest
Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« on: February 16, 2018, 12:40:48 am »
I predominantly use clang on Windows for Development. I am pretty expert with Visual Studio. I have the latest LLVM/Clang 7.0 fully integrated with VS2017 including full LLVM lld PDB generation for native windows debugging.

I would like to enable building [/b]Code::Blocks itself using clang. Currently it seems to depend on minggw/gcc to build itself (but with clang that should not be required).

Anyone looked at this or explored it?
As a cross-platform development compiler; clang is the cross-compiler that is most completely integrated into native windows ABI development Windows. I'd be happy to answer any questions.

Check this "Jan 09 Blog" article http://planet.clang.org/

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« Reply #1 on: February 16, 2018, 01:01:12 am »
1. there is no clang 7, this is trunk compiler...
2. as start try to compile wxwidgets
3. if you get 2 done, building cb will be easy...
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« Reply #2 on: February 16, 2018, 07:56:19 pm »
1. there is no clang 7, this is trunk compiler...
2. as start try to compile wxwidgets
3. if you get 2 done, building cb will be easy...

Remember Code::Blocks works best with an Shared/DLL build of wxWidgets.

Just tried to build wxwidgets recent git master branch and it failed to build DLL using Clang 5.0.1.

Tim S.
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« Reply #3 on: February 16, 2018, 08:35:46 pm »
Just tried to build wxwidgets recent git master branch and it failed to build DLL using Clang 5.0.1.
How are you trying? I can't find any instructions about how to use clang to build wxwidgets on windows?
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« Reply #4 on: February 16, 2018, 08:43:20 pm »
Just tried to build wxwidgets recent git master branch and it failed to build DLL using Clang 5.0.1.
How are you trying? I can't find any instructions about how to use clang to build wxwidgets on windows?

I am building under MSys2 (an fork of Cygwin) using configure/make.

It built an static wxWidgets without build errors; did not try running the sample to see if library works.

Followed an modified version of the docs/msw/msys2-msw.txt that I wrote and submitted to wxWidgets team a while ago.

Code
  CC=clang CXX=clang++ \
    ../configure --with-msw \
    --enable-shared \
    --disable-precomp-headers \

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« Reply #5 on: February 16, 2018, 09:20:29 pm »
Ok, Msys2 and cygwin are things I'm not interested at all...
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
« Reply #6 on: February 17, 2018, 04:53:41 am »
You might try this command and see if it works for you.

Code
mingw32-make -f makefile.gcc CC=clang CXX=clang++ MONOLITHIC=0 SHARED=0 UNICODE=1 BUILD=debug

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org