Move 3rd party libs needed on Windows to 'vendor' folder

This commit is contained in:
Thomas Jensen 2021-11-01 14:18:50 +01:00
parent d732154bf8
commit 96a79f309c
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB
4 changed files with 13 additions and 10 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@
*.o
*.a
/test/*.tmp
/vendor/
# Legacy locations of generated files (no longer in use)
/src/boxes

View File

@ -6,8 +6,8 @@
"${workspaceFolder}/src",
"${workspaceFolder}/src/misc",
"${workspaceFolder}/out",
"${workspaceFolder}/pcre2-10.36/src",
"${workspaceFolder}/cmocka-1.1.0/include"
"${workspaceFolder}/vendor/pcre2-10.36/src",
"${workspaceFolder}/vendor/cmocka-1.1.0/include"
],
"defines": [
"_DEBUG",

View File

@ -9,7 +9,8 @@
"**/out": true,
"**/flex_bison_*": true,
"**/pcre2-*": true,
"**/cmocka-*": true
"**/cmocka-*": true,
"**/vendor": true
},
"editor.autoClosingBrackets": "never",
"editor.dragAndDrop": false,

View File

@ -29,11 +29,11 @@ PKG_NAME = boxes-$(BVERSION)
OUT_DIR = out
WIN_PCRE2_VERSION = 10.36
WIN_PCRE2_DIR = pcre2-$(WIN_PCRE2_VERSION)
WIN_PCRE2_DIR = vendor/pcre2-$(WIN_PCRE2_VERSION)
WIN_FLEX_BISON_VERSION = 2.5.24
WIN_FLEX_BISON_DIR = flex_bison_$(WIN_FLEX_BISON_VERSION)
WIN_FLEX_BISON_DIR = vendor/flex_bison_$(WIN_FLEX_BISON_VERSION)
WIN_CMOCKA_VERSION = 1.1.0
WIN_CMOCKA_DIR = cmocka-$(WIN_CMOCKA_VERSION)
WIN_CMOCKA_DIR = vendor/cmocka-$(WIN_CMOCKA_VERSION)
.PHONY: clean build cov win32 debug win32.debug win32.pcre infomsg replaceinfos test covtest \
package win32.package package_common utest win32.utest
@ -60,9 +60,10 @@ win32.prereq:
curl -LO https://downloads.sourceforge.net/project/winflexbison/win_flex_bison-$(WIN_FLEX_BISON_VERSION).zip
curl -LO https://cmocka.org/files/$(WIN_CMOCKA_VERSION:%.0=%)/cmocka-$(WIN_CMOCKA_VERSION)-mingw.zip
# unpack components
tar xfz $(WIN_PCRE2_DIR).tar.gz
mkdir -p vendor
unzip win_flex_bison-$(WIN_FLEX_BISON_VERSION).zip -d $(WIN_FLEX_BISON_DIR)
unzip cmocka-$(WIN_CMOCKA_VERSION)-mingw.zip
tar -C vendor -xzf pcre2-$(WIN_PCRE2_VERSION).tar.gz
unzip cmocka-$(WIN_CMOCKA_VERSION)-mingw.zip -d vendor
# build the pcre2 dependency (only needed on Windows MinGW)
cd $(WIN_PCRE2_DIR) ; \
./configure --disable-pcre2-8 --disable-pcre2-16 --enable-pcre2-32 --disable-shared \
@ -161,10 +162,10 @@ covtest:
utest:
$(MAKE) -C utest BOXES_PLATFORM=unix utest
win32.utest:
win32.utest: $(OUT_DIR)
cp $(WIN_CMOCKA_DIR)/bin/cmocka.dll $(OUT_DIR)/
$(MAKE) -C utest BOXES_PLATFORM=win32 C_INCLUDE_PATH=../$(WIN_PCRE2_DIR)/src:../$(WIN_CMOCKA_DIR)/include \
LDFLAGS="-L../$(WIN_PCRE2_DIR)/.libs -L../$(WIN_CMOCKA_DIR)/lib" utest
LDFLAGS_ADDTL="-L../$(WIN_PCRE2_DIR)/.libs -L../$(WIN_CMOCKA_DIR)/lib" utest
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Cleanup