Skip to content

Commit

Permalink
give up on kludging wx-config, just add wx/include to cache
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbradsmith committed Apr 13, 2024
1 parent 11cb875 commit 1334e9c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ jobs:
id: cache-wx
uses: actions/cache@v4
with:
path: wxlib
path: |
wxlib
wx/include
key: wx-ubuntu-${{ env.WXHASH }}
# Cache needs the source include because wx-config does not reference the cmake --install
# directories, only the source build, for some reason?
- name: Build wxWidgets
if: steps.cache-wx.outputs.cache-hit != 'true'
run: make wxlib
Expand Down
2 changes: 1 addition & 1 deletion makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ else
DLL_SUFFIX ?= .so
WXL_LIBDIR ?= .
# wx-config
WXL_CONFIG ?= $(WXL_DIR)/$(WXL_CMAKEDIR)/wx-config-install
WXL_CONFIG ?= $(WXL_DIR)/$(WXL_CMAKEDIR)/wx-config
endif

ifneq ("$(WXL_CONFIG)","")
Expand Down
9 changes: 0 additions & 9 deletions makefile.wx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ wxlib: submodules
(cd $(WXOUT)/$(WXCMAKE) && cmake $(WXREL) $(WXCONF) $(WXCONF_EXTRA) $(WXBUILD_TYPE))
(cd $(WXOUT)/$(WXCMAKE) && cmake --build .)
(cd $(WXOUT)/$(WXCMAKE) && cmake --install . --prefix ..)
(cd $(WXOUT)/$(WXCMAKE) && echo '#!/bin/sh' > wx-config-install)
(cd $(WXOUT)/$(WXCMAKE) && echo "this_prefix=\"$(shell PWD)/..\"" >> wx-config-install)
(cd $(WXOUT)/$(WXCMAKE) && echo "this_exec_prefix=\"$(shell PWD)/..\"" >> wx-config-install)
(cd $(WXOUT)/$(WXCMAKE) && tail -n 2 wx-config | sed "s/\/lib\/wx\/config\//\/$(WXCMAKE)\/lib\/wx\/config\//g" >> wx-config-install)
(cd $(WXOUT)/$(WXCMAKE) && chmod +x wx-config-install)

# For some strange reason wx-config references the source and output folders of cmake,
# rather than the products of --install. for this reason I've cobbled together wx-config-install
# to act as a substitute.

clean:
rm -f -r $(WXOUT)/$(WXCMAKE)
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Otherwise on other platforms there is probably some wxWidgets library package yo
* `export WXL_CONFIG=/path/to/wx-config`
* `make`

On Windows (including MSYS2), you don't need to keep the cmake generated directories in wxlib once you've built the libraries. Everything needed will be in `wxlib\include` and `wxlib\lib`, and the other folders can be deleted, if you'd like to recover some space (wxWidgets is unfortunately large). On other platforms, the `wx-config` utility will be contained there, so you should at least keep that and whatever other files it uses to determine its build configuration.
On Windows (including MSYS2), you don't need to keep the cmake generated directories in wxlib once you've built the libraries. Everything needed will be in `wxlib\include` and `wxlib\lib`, and the other folders can be deleted, if you'd like to recover some space (wxWidgets is unfortunately large). On other platforms, the `wx-config` utility will be contained there, so you should at least keep that and whatever other files it uses to determine its build configuration. (`wx-config` does not appear to be aware of `cmake --install` and will reference the source includes, and uninstalled library binaries.)

### Make Targets

Expand Down

0 comments on commit 1334e9c

Please sign in to comment.