msys2 mingw CodeLite build directions

Discussion about CodeLite development process and patches
stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

msys2 mingw CodeLite build directions

Post by stahta01 »

OLD PR DELETED Updated directions still have not been fully tested; requires https://github.com/eranif/codelite/pull/2783 to work.
Posted new PR https://github.com/eranif/codelite/pull/2786 that should allow these directions to be used.

Tim S.

Code: Select all

# msys2 mingw CodeLite build directions

# Open MSys2 MinGW prompt either MinGW32 or MinGW64

pacman -S --needed ${MINGW_PACKAGE_PREFIX}-wxWidgets && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-hunspell && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-clang && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-cmake && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-gcc && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-boost && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-libssh && \
pacman -S --needed ${MINGW_PACKAGE_PREFIX}-pkgconf && \
pacman -S --needed make

# cd "C:\repos\git" && git clone https://github.com/eranif/codelite.git && cd codelite
# cd "C:\repos\git" && cd codelite

# Confirm we are in the codelite git folder and remove old build folder
cd ../../codelite || cd ../codelite && rm -fr build-release && \
mkdir -p build-release && cd build-release && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DCL_PREFIX=${MINGW_PREFIX}/local -Wno-dev -G"MSYS Makefiles" \
         -DWITH_WX_CONFIG=${MINGW_PREFIX}/bin/wx-config -DwxWidgets_wxrc_EXECUTABLE=${MINGW_PREFIX}/bin/wxrc.exe && \
cmake --build .  && \
cmake --build . --target install

# To launch CodeLite:
${MINGW_PREFIX}/local/bin/codelite.exe
Last edited by stahta01 on Tue Jul 27, 2021 5:17 am, edited 2 times in total.
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by eranif »

Thanks for this effort, I might changing my build instructions for Windows to use this method as the current method requires the user to download CodeLite and make some preparations (I also assume that NOT many people are building CodeLite for Windows)
Maybe this will change things up.

One question:
On Windows, we build using PCH, this boosts the build process significantly, does your change also add PCH?

Make sure you have read the HOW TO POST thread
stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

It does not use PCH; I did not use PCH on purpose while building the MSys2 Package and I did nothing to add it.

I will see if something simple is needed to use PCH; Note using PCH with MinGW GCC is harder that using PCH with GCC under Linux so it is likely broken.

Edit1: I just tried adding "-DWITH_PCH=1" and it fails to build within a few seconds.
Edit3: Turns out my build directions end up in codelite/codelite folder which makes next build fail.
Edit2: False alarm I am now building with PCH; we see if it works.
Edit4: It is saying PCH is invalid. It will likely be a lot of work to fix this.

Code: Select all

Building CXX object sdk/wxshapeframework/CMakeFiles/wxshapeframework.dir/src/RoundRectShape.cpp.obj
codelite/PCH/precompiled_header_release.h.gch: not used because `YY_NEVER_INTERACTIVE' is defined [-Winvalid-pch]

Tim S.

stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

I will look at the CodeLite IDE PCH building in hopes that it can be easy to add its method to CMake.
All I remember is it uses more than one PCH file.

Tim S.

stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

Okay, at first glance the CodeLite IDE does not really use PCH to build under Windows.

So, I am going to have to decide if that is true and fix it before trying to add PCH to windows cmake building.
Edit: Or decide to add PCH to windows cmake building before trying to fix PCH building using CodeLite IDE.

Tim S.

User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by eranif »

Okay, at first glance the CodeLite IDE does not really use PCH to build under Windows.

Hmm, it does :)

there are 3 projects that are not using PCH, the rest do.
There are 4 PCH files in CodeLite:

  • One for libcodelite
  • One for building libplugin + all the plugins
  • One for building CodeLite IDE itself
  • One for building wxCrafter

The reason for 3 PCH files is the difference of macros required by each type

Make sure you have read the HOW TO POST thread
stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

eranif wrote: Fri Jul 23, 2021 8:01 pm

Okay, at first glance the CodeLite IDE does not really use PCH to build under Windows.

Hmm, it does :)

there are 3 projects that are not using PCH, the rest do.
There are 4 PCH files in CodeLite:

  • One for libcodelite
  • One for building libplugin + all the plugins
  • One for building CodeLite IDE itself
  • One for building wxCrafter

The reason for 3 PCH files is the difference of macros required by each type

Thanks, I will look at "libcodelite" and see if/how it works. Edit: Might try wxCrafter instead.
I did find a few more PCH gch files after the CodeLite IDE was running much longer.
I was mislead by the seeing that only one PCH was built by I think the PCH project; maybe the others are built later by this project or more likely by other projects.
I understand the Code::Blocks project build system; but, the CodeLite project build system is very much a mystery to me.

Tim S.

stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

I have started by disabling PCH for these cmake projects.

databaselayer
wxshapeframework
wxsqlite3

Now, to figure out how to get PCH to work for libcodelite. Too tired now to think clearly.

Tim S.

stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

By trial and error figured out how to have cmake create "libcodelite_pch.h.gch"; so, while my slow computer is building I need to decide if I wish to finish my prior patch or continue on the PCH patches.

I am leaning towards doing the next to last patch needed by the MSys2 mingw codelite package and then re-start work on these PCH patches.
The last MSys2 mingw package patch is one I do not understand well enough to submit as an PR and plan to leave as an patch applied by the msys2 codelite package.

Tim S.

stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: msys2 mingw CodeLite build directions

Post by stahta01 »

Going to hold off on the PCH cmake changes till https://github.com/eranif/codelite/pull/2784 is applied.

Edit: The PCH changes the same cmake file.
I am working on the mingw cmake PCH changes; but, not certain if I should do an PR till after the above PR is applied.

Tim S.

Post Reply