Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: smallscript on February 16, 2018, 12:40:48 am

Title: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: smallscript 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/ (http://planet.clang.org/)
Title: Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: oBFusCATed 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...
Title: Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: stahta01 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.
 
Title: Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: oBFusCATed 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?
Title: Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: stahta01 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.
Title: Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: oBFusCATed on February 16, 2018, 09:20:29 pm
Ok, Msys2 and cygwin are things I'm not interested at all...
Title: Re: Using Clang (7.0) on Windows to Build Code::Blocks for Windows
Post by: stahta01 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.