From 0832615599ca5ab2f127dee48b2ab5df1927baa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sun, 3 Jan 2021 10:13:55 +0100 Subject: [PATCH] Use versioned tpt-libs Also move bzip2 sources out of their own subproject. --- .github/build.sh | 2 +- meson.build | 15 +++++---------- pch/pch_cpp.h | 1 - {subprojects/tpt-bzip2 => src/bzip2}/LICENSE | 0 .../tpt-bzip2/src => src/bzip2}/blocksort.c | 0 src/{common => bzip2}/bz2wrap.cpp | 2 +- src/{common => bzip2}/bz2wrap.h | 0 {subprojects/tpt-bzip2/src => src/bzip2}/bzlib.c | 0 .../tpt-bzip2/include => src/bzip2}/bzlib.h | 0 .../tpt-bzip2/src => src/bzip2}/bzlib_private.h | 0 .../tpt-bzip2/src => src/bzip2}/compress.c | 0 .../tpt-bzip2/src => src/bzip2}/crctable.c | 0 .../tpt-bzip2/src => src/bzip2}/decompress.c | 0 .../tpt-bzip2/src => src/bzip2}/huffman.c | 0 .../tpt-bzip2/src => src/bzip2}/meson.build | 3 ++- .../tpt-bzip2/src => src/bzip2}/randtable.c | 0 src/client/GameSave.cpp | 2 +- src/common/meson.build | 1 - src/graphics/FontReader.cpp | 2 +- src/graphics/Graphics.cpp | 3 ++- src/gui/font/FontEditor.cpp | 2 +- src/gui/update/UpdateActivity.cpp | 2 +- src/meson.build | 1 + subprojects/tpt-bzip2/meson.build | 14 -------------- ...ibs-prebuilt-lin64-static-v20210103095432.wrap | 6 ++++++ subprojects/tpt-libs-prebuilt-lin64-static.wrap | 6 ------ ...ibs-prebuilt-mac64-static-v20210103095432.wrap | 6 ++++++ subprojects/tpt-libs-prebuilt-mac64-static.wrap | 6 ------ ...bs-prebuilt-win64-dynamic-v20210103095432.wrap | 6 ++++++ subprojects/tpt-libs-prebuilt-win64-dynamic.wrap | 6 ------ ...ibs-prebuilt-win64-static-v20210103095432.wrap | 6 ++++++ subprojects/tpt-libs-prebuilt-win64-static.wrap | 6 ------ 32 files changed, 40 insertions(+), 58 deletions(-) rename {subprojects/tpt-bzip2 => src/bzip2}/LICENSE (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/blocksort.c (100%) rename src/{common => bzip2}/bz2wrap.cpp (99%) rename src/{common => bzip2}/bz2wrap.h (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/bzlib.c (100%) rename {subprojects/tpt-bzip2/include => src/bzip2}/bzlib.h (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/bzlib_private.h (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/compress.c (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/crctable.c (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/decompress.c (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/huffman.c (100%) rename {subprojects/tpt-bzip2/src => src/bzip2}/meson.build (73%) rename {subprojects/tpt-bzip2/src => src/bzip2}/randtable.c (100%) delete mode 100644 subprojects/tpt-bzip2/meson.build create mode 100644 subprojects/tpt-libs-prebuilt-lin64-static-v20210103095432.wrap delete mode 100644 subprojects/tpt-libs-prebuilt-lin64-static.wrap create mode 100644 subprojects/tpt-libs-prebuilt-mac64-static-v20210103095432.wrap delete mode 100644 subprojects/tpt-libs-prebuilt-mac64-static.wrap create mode 100644 subprojects/tpt-libs-prebuilt-win64-dynamic-v20210103095432.wrap delete mode 100644 subprojects/tpt-libs-prebuilt-win64-dynamic.wrap create mode 100644 subprojects/tpt-libs-prebuilt-win64-static-v20210103095432.wrap delete mode 100644 subprojects/tpt-libs-prebuilt-win64-static.wrap diff --git a/.github/build.sh b/.github/build.sh index b46f84667..5f4fa2c03 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -41,7 +41,7 @@ static_flag= if [ $STATIC_DYNAMIC == "static" ]; then static_flag=-Dstatic=prebuilt if [ $PLATFORM_SHORT == "win" ]; then - other_flags+=$'\t-Db_vscrt=mt' + other_flags+=$'\t-Db_vscrt=static_from_buildtype' fi fi if [ $PLATFORM_SHORT == "lin" ]; then diff --git a/meson.build b/meson.build index 19b1fb194..0df7cc716 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,5 @@ project('the-powder-toy', [ 'c', 'cpp' ], version: 'the.cake.is.a.lie', default_options: [ 'cpp_std=c++11', - 'b_vscrt=md', - 'backend_startup_project=powder', ]) prog_python3 = import('python').find_installation('python3') @@ -45,6 +43,7 @@ endif uopt_static = get_option('static') use_tpt_libs = false +tpt_libs_vtag = 'v20210103095432' if uopt_static == 'system' if copt_platform == 'windows' error('no way to find static system libraries on windows') @@ -52,18 +51,18 @@ if uopt_static == 'system' elif uopt_static == 'prebuilt' if copt_platform == 'windows' use_tpt_libs = true - tpt_libs = subproject('tpt-libs-prebuilt-win64-static') + tpt_libs = subproject('tpt-libs-prebuilt-win64-static-' + tpt_libs_vtag) elif copt_platform == 'linux' use_tpt_libs = true - tpt_libs = subproject('tpt-libs-prebuilt-lin64-static') + tpt_libs = subproject('tpt-libs-prebuilt-lin64-static-' + tpt_libs_vtag) elif copt_platform == 'macosx' use_tpt_libs = true - tpt_libs = subproject('tpt-libs-prebuilt-mac64-static') + tpt_libs = subproject('tpt-libs-prebuilt-mac64-static-' + tpt_libs_vtag) endif else if copt_platform == 'windows' use_tpt_libs = true - tpt_libs = subproject('tpt-libs-prebuilt-win64-dynamic') + tpt_libs = subproject('tpt-libs-prebuilt-win64-dynamic-' + tpt_libs_vtag) endif endif @@ -112,7 +111,6 @@ endif threads_dep = dependency('threads') zlib_dep = use_tpt_libs ? tpt_libs.get_variable('zlib_dep') : dependency('zlib', static: uopt_static == 'system') sdl2_dep = use_tpt_libs ? tpt_libs.get_variable('sdl2_dep') : dependency('sdl2', static: uopt_static == 'system') -bzip2_dep = subproject('tpt-bzip2').get_variable('bzip2_dep') if copt_msvc if uopt_x86_sse_level >= 30 @@ -258,7 +256,6 @@ if get_option('build_powder') threads_dep, zlib_dep, sdl2_dep, - bzip2_dep, lua_opt_dep, curl_opt_dep, fftw_opt_dep, @@ -285,7 +282,6 @@ if get_option('build_render') render_deps = [ threads_dep, zlib_dep, - bzip2_dep, ] executable( 'render', @@ -305,7 +301,6 @@ if get_option('build_font') threads_dep, zlib_dep, sdl2_dep, - bzip2_dep, ] if copt_platform == 'windows' font_deps += other_dep diff --git a/pch/pch_cpp.h b/pch/pch_cpp.h index dff1ec6e7..e8fead44b 100644 --- a/pch/pch_cpp.h +++ b/pch/pch_cpp.h @@ -82,7 +82,6 @@ # include #endif -#include #include #include #include diff --git a/subprojects/tpt-bzip2/LICENSE b/src/bzip2/LICENSE similarity index 100% rename from subprojects/tpt-bzip2/LICENSE rename to src/bzip2/LICENSE diff --git a/subprojects/tpt-bzip2/src/blocksort.c b/src/bzip2/blocksort.c similarity index 100% rename from subprojects/tpt-bzip2/src/blocksort.c rename to src/bzip2/blocksort.c diff --git a/src/common/bz2wrap.cpp b/src/bzip2/bz2wrap.cpp similarity index 99% rename from src/common/bz2wrap.cpp rename to src/bzip2/bz2wrap.cpp index e08985872..0b59ac193 100644 --- a/src/common/bz2wrap.cpp +++ b/src/bzip2/bz2wrap.cpp @@ -1,6 +1,6 @@ #include "bz2wrap.h" -#include +#include "bzlib.h" #include #include diff --git a/src/common/bz2wrap.h b/src/bzip2/bz2wrap.h similarity index 100% rename from src/common/bz2wrap.h rename to src/bzip2/bz2wrap.h diff --git a/subprojects/tpt-bzip2/src/bzlib.c b/src/bzip2/bzlib.c similarity index 100% rename from subprojects/tpt-bzip2/src/bzlib.c rename to src/bzip2/bzlib.c diff --git a/subprojects/tpt-bzip2/include/bzlib.h b/src/bzip2/bzlib.h similarity index 100% rename from subprojects/tpt-bzip2/include/bzlib.h rename to src/bzip2/bzlib.h diff --git a/subprojects/tpt-bzip2/src/bzlib_private.h b/src/bzip2/bzlib_private.h similarity index 100% rename from subprojects/tpt-bzip2/src/bzlib_private.h rename to src/bzip2/bzlib_private.h diff --git a/subprojects/tpt-bzip2/src/compress.c b/src/bzip2/compress.c similarity index 100% rename from subprojects/tpt-bzip2/src/compress.c rename to src/bzip2/compress.c diff --git a/subprojects/tpt-bzip2/src/crctable.c b/src/bzip2/crctable.c similarity index 100% rename from subprojects/tpt-bzip2/src/crctable.c rename to src/bzip2/crctable.c diff --git a/subprojects/tpt-bzip2/src/decompress.c b/src/bzip2/decompress.c similarity index 100% rename from subprojects/tpt-bzip2/src/decompress.c rename to src/bzip2/decompress.c diff --git a/subprojects/tpt-bzip2/src/huffman.c b/src/bzip2/huffman.c similarity index 100% rename from subprojects/tpt-bzip2/src/huffman.c rename to src/bzip2/huffman.c diff --git a/subprojects/tpt-bzip2/src/meson.build b/src/bzip2/meson.build similarity index 73% rename from subprojects/tpt-bzip2/src/meson.build rename to src/bzip2/meson.build index bc73dc68b..60aa7ed13 100644 --- a/subprojects/tpt-bzip2/src/meson.build +++ b/src/bzip2/meson.build @@ -1,5 +1,6 @@ -bzip2_src = files( +common_files += files( 'blocksort.c', + 'bz2wrap.cpp', 'bzlib.c', 'compress.c', 'crctable.c', diff --git a/subprojects/tpt-bzip2/src/randtable.c b/src/bzip2/randtable.c similarity index 100% rename from subprojects/tpt-bzip2/src/randtable.c rename to src/bzip2/randtable.c diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index 86121e6d5..6e6e7a493 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -5,9 +5,9 @@ #include #include #include -#include #include +#include "bzip2/bzlib.h" #include "Config.h" #include "Format.h" #include "hmap.h" diff --git a/src/common/meson.build b/src/common/meson.build index 9e1f451ff..f4d8939e2 100644 --- a/src/common/meson.build +++ b/src/common/meson.build @@ -1,5 +1,4 @@ common_files += files( - 'bz2wrap.cpp', 'String.cpp', 'tpt-rand.cpp', ) diff --git a/src/graphics/FontReader.cpp b/src/graphics/FontReader.cpp index 334eb717f..84aed9311 100644 --- a/src/graphics/FontReader.cpp +++ b/src/graphics/FontReader.cpp @@ -1,6 +1,6 @@ #include "FontReader.h" -#include "common/bz2wrap.h" +#include "bzip2/bz2wrap.h" #include "font.h" unsigned char *font_data = nullptr; diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index f9b24eefc..af765b3d3 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -4,7 +4,8 @@ #include #include #include -#include + +#include "bzip2/bzlib.h" #include "FontReader.h" #ifdef HIGH_QUALITY_RESAMPLE diff --git a/src/gui/font/FontEditor.cpp b/src/gui/font/FontEditor.cpp index 2226f5097..89852fa50 100644 --- a/src/gui/font/FontEditor.cpp +++ b/src/gui/font/FontEditor.cpp @@ -5,7 +5,7 @@ #include #include "FontEditor.h" -#include "common/bz2wrap.h" +#include "bzip2/bz2wrap.h" #include "Config.h" #include "gui/interface/Textbox.h" diff --git a/src/gui/update/UpdateActivity.cpp b/src/gui/update/UpdateActivity.cpp index 30742e401..1b9b5472a 100644 --- a/src/gui/update/UpdateActivity.cpp +++ b/src/gui/update/UpdateActivity.cpp @@ -1,6 +1,6 @@ #include "UpdateActivity.h" -#include +#include "bzip2/bzlib.h" #include "gui/dialogues/ConfirmPrompt.h" #include "gui/interface/Engine.h" diff --git a/src/meson.build b/src/meson.build index ac2b84c0b..221958fc8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -30,6 +30,7 @@ common_files = files( ) subdir('bson') +subdir('bzip2') subdir('client') subdir('common') subdir('debug') diff --git a/subprojects/tpt-bzip2/meson.build b/subprojects/tpt-bzip2/meson.build deleted file mode 100644 index 28e2b183c..000000000 --- a/subprojects/tpt-bzip2/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -project('tpt-bzip2', 'c') - -subdir('src') - -bzip2_inc = include_directories('include') -bzip2_sta = static_library( - 'bzip2', - sources: bzip2_src, - include_directories: bzip2_inc, -) -bzip2_dep = declare_dependency( - link_with: bzip2_sta, - include_directories: bzip2_inc, -) diff --git a/subprojects/tpt-libs-prebuilt-lin64-static-v20210103095432.wrap b/subprojects/tpt-libs-prebuilt-lin64-static-v20210103095432.wrap new file mode 100644 index 000000000..7551e1b8f --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-lin64-static-v20210103095432.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-lin64-static-v20210103095432 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20210103095432/tpt-libs-prebuilt-lin64-static-v20210103095432.zip +source_filename = tpt-libs-prebuilt-lin64-static-v20210103095432.zip +source_hash = d2ede0e8fb54802789cbd729397cb8083151cbbf8219cdc0d70844e0a03196f4 diff --git a/subprojects/tpt-libs-prebuilt-lin64-static.wrap b/subprojects/tpt-libs-prebuilt-lin64-static.wrap deleted file mode 100644 index af12eff1f..000000000 --- a/subprojects/tpt-libs-prebuilt-lin64-static.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-lin64-static - -source_url = https://github.com/LBPHacker/tpt-libs/releases/download/v20210103011010/tpt-libs-prebuilt-lin64-static.zip -source_filename = tpt-libs-prebuilt-lin64-static.zip -source_hash = 042c9687cc418c1425c2c95c9d48bb76972f3df9b06d131409c1d3c67c22c53a diff --git a/subprojects/tpt-libs-prebuilt-mac64-static-v20210103095432.wrap b/subprojects/tpt-libs-prebuilt-mac64-static-v20210103095432.wrap new file mode 100644 index 000000000..b462a6a0c --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-mac64-static-v20210103095432.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-mac64-static-v20210103095432 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20210103095432/tpt-libs-prebuilt-mac64-static-v20210103095432.zip +source_filename = tpt-libs-prebuilt-mac64-static-v20210103095432.zip +source_hash = 5b1e20dd5ef6bd4220cb6d3cc8b5aa5d3ae20a8b89ec05ef56958fcf58085e7a diff --git a/subprojects/tpt-libs-prebuilt-mac64-static.wrap b/subprojects/tpt-libs-prebuilt-mac64-static.wrap deleted file mode 100644 index 40256ac47..000000000 --- a/subprojects/tpt-libs-prebuilt-mac64-static.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-mac64-static - -source_url = https://github.com/LBPHacker/tpt-libs/releases/download/v20210103011010/tpt-libs-prebuilt-mac64-static.zip -source_filename = tpt-libs-prebuilt-mac64-static.zip -source_hash = 3e848020919ed5993fcef0f579d1401227659a31a621324e0830d7bebb4b9b10 diff --git a/subprojects/tpt-libs-prebuilt-win64-dynamic-v20210103095432.wrap b/subprojects/tpt-libs-prebuilt-win64-dynamic-v20210103095432.wrap new file mode 100644 index 000000000..65c87b7bc --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-win64-dynamic-v20210103095432.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-win64-dynamic-v20210103095432 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20210103095432/tpt-libs-prebuilt-win64-dynamic-v20210103095432.zip +source_filename = tpt-libs-prebuilt-win64-dynamic-v20210103095432.zip +source_hash = 84226bce4c89028479f9c41860cfae3ed07bfbabf9f4316f11cffa0bf8964624 diff --git a/subprojects/tpt-libs-prebuilt-win64-dynamic.wrap b/subprojects/tpt-libs-prebuilt-win64-dynamic.wrap deleted file mode 100644 index 11c0bb3b2..000000000 --- a/subprojects/tpt-libs-prebuilt-win64-dynamic.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-win64-dynamic - -source_url = https://github.com/LBPHacker/tpt-libs/releases/download/v20210103011010/tpt-libs-prebuilt-win64-dynamic.zip -source_filename = tpt-libs-prebuilt-win64-dynamic.zip -source_hash = 5e1fbee5b39413ef9703ea0455e9f2c117a6f34c59c225945381a50fe10e5aef diff --git a/subprojects/tpt-libs-prebuilt-win64-static-v20210103095432.wrap b/subprojects/tpt-libs-prebuilt-win64-static-v20210103095432.wrap new file mode 100644 index 000000000..98f8a3541 --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-win64-static-v20210103095432.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-win64-static-v20210103095432 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20210103095432/tpt-libs-prebuilt-win64-static-v20210103095432.zip +source_filename = tpt-libs-prebuilt-win64-static-v20210103095432.zip +source_hash = b60bc426655e9bb8583998aff5c004ed3e61c3ceac7b28c3a9834bef46c43437 diff --git a/subprojects/tpt-libs-prebuilt-win64-static.wrap b/subprojects/tpt-libs-prebuilt-win64-static.wrap deleted file mode 100644 index 95dc3bc83..000000000 --- a/subprojects/tpt-libs-prebuilt-win64-static.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-win64-static - -source_url = https://github.com/LBPHacker/tpt-libs/releases/download/v20210103011010/tpt-libs-prebuilt-win64-static.zip -source_filename = tpt-libs-prebuilt-win64-static.zip -source_hash = 6348d2dcd99ceedb63fb7c27b4fd4d02f9837244981eaf60ed2d255e25d4dfe3