Building wxWidgets from Source
Windows
CodeLite uses MSYS2 to provide the compiler and related tools.
- Open an MSYS2 shell and install all prerequisites as described in the linked guide.
- Clone the wxWidgets repository and initialize its sub‑modules:
git clone https://github.com/wxWidgets/wxWidgets
cd wxWidgets
git submodule update --init
Release build
mkdir .build-release
cd .build-release
cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release \
-DwxBUILD_DEBUG_LEVEL=0 \
-DwxBUILD_MONOLITHIC=1 -DwxBUILD_SAMPLES=ALL -DwxUSE_STL=1 \
-DCMAKE_INSTALL_PREFIX=$HOME/root
mingw32-make -j$(nproc) install
Debug build
mkdir .build-debug
cd .build-debug
cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxBUILD_DEBUG_LEVEL=1 \
-DwxBUILD_SAMPLES=ALL -DwxBUILD_MONOLITHIC=1 -DwxUSE_STL=1 \
-DCMAKE_INSTALL_PREFIX=$HOME/root
mingw32-make -j$(nproc) install
Linux
To build wxWidgets on Linux you need the following packages:
- GTK development libraries
libgtk2.0-devfor GTK 2libgtk-3-devfor GTK 3pkg-config(usually included with the GTK development package)- Build essentials (
g++,make, etc.) gitcmake
Install the prerequisites on Ubuntu with:
sudo apt-get install libgtk-3-dev \
pkg-config \
build-essential \
git \
cmake \
libsqlite3-dev \
libssh-dev \
libedit-dev \
libhunspell-dev \
xterm
Build sequence
mkdir -p $HOME/devl
cd $HOME/devl
git clone https://github.com/wxWidgets/wxWidgets
cd wxWidgets
git submodule update --init
mkdir -p .build-release
cd .build-release
../configure --disable-debug_flag --with-gtk=3 --enable-stl
make -j$(nproc) && sudo make install
macOS
Prerequisites
- Install Homebrew – https://brew.sh/
- Run
brew install cmake git - Download the latest Xcode from the App Store
- In Xcode, open Preferences → Downloads and install the Command Line Tools (adds
clang/clang++to/usr/bin)
Building with CMake
mkdir -p $HOME/devl
cd $HOME/devl
git clone https://github.com/wxWidgets/wxWidgets.git
cd wxWidgets
git submodule update --init
mkdir .build-release
cd .build-release
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DwxBUILD_DEBUG_LEVEL=0 \
-DwxBUILD_MONOLITHIC=1 \
-DwxBUILD_SAMPLES=ALL
make -j$(sysctl -n hw.physicalcpu)
sudo make install