Page 1 of 2
msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 5:04 am
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
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 3:37 pm
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?
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 4:59 pm
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.
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 6:17 pm
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.
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 6:36 pm
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.
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 8:01 pm
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
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 8:48 pm
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.
Re: msys2 mingw CodeLite build directions
Posted: Fri Jul 23, 2021 10:24 pm
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.
Re: msys2 mingw CodeLite build directions
Posted: Sat Jul 24, 2021 3:54 am
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.
Re: msys2 mingw CodeLite build directions
Posted: Sat Jul 24, 2021 6:50 am
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.