Creating Release Builds - Ravbug/wxWidgetsTemplate GitHub Wiki
macOS
For testing:
- Select either the Dynamic or Static app scheme from the scheme selector.
- Select
Product -> Scheme -> Edit Schememenus. - Select
Releasefrom the Build Configuration dropdown, then press Close.
- By default wxWidgets' build architecture is set to a deprecated version (i386) and will not compile correctly on release mode. Follow the steps below to fix this:
- Open
wxcocoa.xcodeprojusing the left sidebar - Select the Target your app scheme is using
- Under Build Settings, change
Architecturesto anything except i386.
- Open
- Build and Run your app.
For Distribution:
- Select either the Dynamic or Static app scheme from the scheme selector.
- Follow Step 4 above (unless you have already done it)
- Press
Product -> Archivemenus. This will create a special release build, open the Archives window, and select the archive automatically. - In the Archives window right sidebar, press
Distribute Content. SelectBuild Productson the popup dialog, then press Next.
- Choose a location to write the archive, and a name for the archive.
- Open the folder which Xcode wrote, in the location where you told it to, and expand the
Products/ApplicationsFolder. Your release built application is located inside there. If you have no external libraries, you do not need the other folders it creates. - (Optional) In the archives dialog, delete the archive (Right click ->
Delete Archive)
Windows
For Testing
- Select
Releasefor your current Platform from the dropdown in the main menu.

- Run the release build in the debugger using the green triangle button. Note that debugging release-mode builds is more difficult than debug-mode builds.
For Distribution
- Go to
Build -> Batch Build - Check the boxes for
applicationnext to Release Win32 and Release x64 and pressRebuild
3. The x86 build is located inside Release/, and the x64 build is located inside x64/Release. You should only need to distribute the .exe files.
Linux
Cross-compilation note!
For best compatibility, compile your release build on the oldest operating system that you support to avoid issues with glibc on other operating systems. For example, I use Ubuntu LTS 18.04 to generate release builds.
For testing
- Run
make clean && make release. The resulting executable is located inlinux-build/.
Packaging for release
The preferred way to generate a release for your users to download is by using AppImage. This template project provides a Make target which will generate an AppImage file out of your code. AppImageTool will be downloaded automatically for your platform and stored in the temporary build directory.
- If you are linking any libraries dynamically, Modify
linux-pkg.shto ensure that all dynamic libraries and other dependencies get included in the packaged app. - Run
make linux-pkg. A.AppImagefile is generated in thelinux-buildproject directory. It is an executable that is ready to be delivered to your users.- To make an AppImage with different flags for wxWidgets, assign them to the WXFLAGS variable:
make linux-pkg WXFLAGS=--with-openglor edit theWXFLAGSassignment in the makefile. The latter is preferred. - To make an AppImage with a dynamically linked wxWidgets, simply add
Dynamic=1to your command:make linux-pkg Dynamic=1. This is not compatible with monolithic! If you want to use the monolithic library, you must editlinux-pkg.shto copy the monolithic shared library instead of the separated libraries.
- To make an AppImage with different flags for wxWidgets, assign them to the WXFLAGS variable:
If you do not want to make an AppImage, for example to submit to a package manager, use the release target instead. With this target, you must manage any shared libraries manually.