diff --git a/.github/build.sh b/.github/build.sh index ff6d974b3..9c7b46f5d 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -69,11 +69,11 @@ if [ $PLATFORM_SHORT == "lin" ]; then # pthread_create, thanks to weak symbols in libstdc++.so (or something). See # https://gcc.gnu.org/legacy-ml/gcc-help/2017-03/msg00081.html other_flags+=$'\t-Db_asneeded=false\t-Dcpp_link_args=-Wl,--no-as-needed' - if [ $STATIC_DYNAMIC == "static" ]; then + if [ $STATIC_DYNAMIC == "static" ] && [ $TOOLSET_SHORT == "gcc" ]; then other_flags+=$'\t-Dbuild_render=true\t-Dbuild_font=true' fi fi -if [ $PLATFORM_SHORT == "win" ]; then +if [ $TOOLSET_SHORT == "mingw" ]; then bin_suffix=$bin_suffix.exe fi stable_or_beta="n" @@ -107,6 +107,9 @@ lto_flag=-Db_lto=true if [ $TOOLSET_SHORT == "mingw" ]; then # This simply doesn't work with MinGW. I have no idea why and I also don't care. lto_flag= + if [ $PLATFORM_SHORT == "lin" ]; then + other_flags+=$'\t--cross-file=.github/mingw-ghactions.ini' + fi fi meson -Dbuildtype=release -Db_pie=false -Db_staticpic=false $lto_flag $static_flag -Dinstall_check=true $other_flags build cd build diff --git a/.github/mingw-ghactions.ini b/.github/mingw-ghactions.ini new file mode 100644 index 000000000..53e48de8a --- /dev/null +++ b/.github/mingw-ghactions.ini @@ -0,0 +1,14 @@ +[constants] +prefix = 'x86_64-w64-mingw32' + +[binaries] +c = prefix + '-gcc-posix' +cpp = prefix + '-g++-posix' +strip = prefix + '-strip' +windres = prefix + '-windres' + +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a88ce0cad..223ed1a4f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -48,10 +48,10 @@ jobs: # --------------+------------+------------+------------+------------+------------+------------+ # gcc-static | | | NO | NO | NO | NO | # msvc-static | NO | NO | | NO | NO | | -# mingw-static | NO | NO | | NO | NO | NO | +# mingw-static | | NO | | NO | NO | NO | # gcc-dynamic | | | NO | NO | NO | NO | # msvc-dynamic | NO | NO | | NO | NO | | -# mingw-dynamic | NO | NO | | NO | NO | NO | +# mingw-dynamic | | NO | | NO | NO | NO | # # Please keep this matrix in sync with the other one in this file, see the ### blocks. # The only difference should be that the second matrix has all mingw cells disabled; we don't publish mingw builds on starcatcher. @@ -65,8 +65,6 @@ jobs: exclude: - toolset_short: mingw machine_short: i686 # remove this line after copying the matrix below - - toolset_short: mingw # remove this line after copying the matrix below - platform_short: lin # remove this line after copying the matrix below - toolset_short: mingw # remove this line after copying the matrix below platform_short: mac # remove this line after copying the matrix below - machine_short: i686 @@ -92,6 +90,10 @@ jobs: - platform_short: win os: windows-2019 suffix: '.exe' + - platform_short: lin + toolset_short: mingw + os: ubuntu-20.04 + suffix: '.exe' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -99,6 +101,8 @@ jobs: python-version: '3.10' - id: get_type run: python3 ./.github/get-type.py ${{ github.ref }} + - if: matrix.platform_short == 'lin' && matrix.toolset_short == 'mingw' + run: sudo apt update && sudo apt install g++-mingw-w64-x86-64 - if: matrix.platform_short == 'mac' uses: Homebrew/actions/setup-homebrew@master - if: matrix.platform_short == 'mac' diff --git a/cross-examples/mingw.ini b/cross-examples/mingw.ini new file mode 100644 index 000000000..2c30577af --- /dev/null +++ b/cross-examples/mingw.ini @@ -0,0 +1,14 @@ +[constants] +prefix = 'x86_64-w64-mingw32' + +[binaries] +c = prefix + '-gcc' +cpp = prefix + '-g++' +strip = prefix + '-strip' +windres = prefix + '-windres' + +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' diff --git a/meson.build b/meson.build index be86d9a14..578c4eee2 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project('the-powder-toy', [ 'c', 'cpp' ], version: 'the.cake.is.a.lie', default_ ]) to_array = generator( - executable('toarray', sources: 'data/ToArray.cpp'), + executable('toarray', sources: 'data/ToArray.cpp', native: true), output: [ '@PLAINNAME@.cpp', '@PLAINNAME@.h' ], arguments: [ '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', '@EXTRA_ARGS@' ] ) @@ -53,7 +53,7 @@ endif uopt_static = get_option('static') use_tpt_libs = 'no' -tpt_libs_vtag = 'v20211022224519' +tpt_libs_vtag = 'v20211224205921' if uopt_static == 'system' if copt_platform == 'win' error('no way to find static system libraries on windows') diff --git a/src/lua/LuaTCPSocket.cpp b/src/lua/LuaTCPSocket.cpp index a42339de1..bbffa03aa 100644 --- a/src/lua/LuaTCPSocket.cpp +++ b/src/lua/LuaTCPSocket.cpp @@ -10,7 +10,7 @@ #include #include #ifdef WIN -# include +# include # include #else # include diff --git a/subprojects/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211022224519.wrap deleted file mode 100644 index ff9e46d8b..000000000 --- a/subprojects/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211022224519.zip -source_filename = tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211022224519.zip -source_hash = 0e05374cec73600254982af6c8faeae93a7b7d5ea36553d0c2d15bb6684005d1 diff --git a/subprojects/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211224205921.wrap new file mode 100644 index 000000000..6d982bd8d --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211224205921.zip +source_filename = tpt-libs-prebuilt-i686-win-msvc-dynamic-v20211224205921.zip +source_hash = 76102a3e3d325d51325ed3213a1fa86f949656306b16b29c7674eba0dd8ac684 diff --git a/subprojects/tpt-libs-prebuilt-i686-win-msvc-static-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-i686-win-msvc-static-v20211022224519.wrap deleted file mode 100644 index 61391c655..000000000 --- a/subprojects/tpt-libs-prebuilt-i686-win-msvc-static-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-i686-win-msvc-static-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-i686-win-msvc-static-v20211022224519.zip -source_filename = tpt-libs-prebuilt-i686-win-msvc-static-v20211022224519.zip -source_hash = 681d23de72148efc25f78c758fe51e543c54459741f597221cf76f38dfd0b606 diff --git a/subprojects/tpt-libs-prebuilt-i686-win-msvc-static-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-i686-win-msvc-static-v20211224205921.wrap new file mode 100644 index 000000000..3f7439238 --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-i686-win-msvc-static-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-i686-win-msvc-static-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-i686-win-msvc-static-v20211224205921.zip +source_filename = tpt-libs-prebuilt-i686-win-msvc-static-v20211224205921.zip +source_hash = 66c481a81ec37f55f1c3aa82eecee4ab12f35142d2501b2f8c2a87c8855345f2 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211022224519.wrap deleted file mode 100644 index 1b2d330b5..000000000 --- a/subprojects/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211022224519.zip -source_filename = tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211022224519.zip -source_hash = 9b04f5f3d8a0912970cfe1bf3445005a930f9a3e5403a2815d9f6280125350f0 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211224205921.wrap new file mode 100644 index 000000000..d74ea673c --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211224205921.zip +source_filename = tpt-libs-prebuilt-x86_64-lin-gcc-static-v20211224205921.zip +source_hash = 5e8ff34c738b85ef22735feba5da4991d385e94b7e518c7f12a127745fa64c7f diff --git a/subprojects/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211022224519.wrap deleted file mode 100644 index 0a21bf7ca..000000000 --- a/subprojects/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211022224519.zip -source_filename = tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211022224519.zip -source_hash = 946f3ae27a5f8b28f6abe2486f6ecc36ba96408fd61ee81a3e2985eb30b02dd7 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211224205921.wrap new file mode 100644 index 000000000..ca778d6ce --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211224205921.zip +source_filename = tpt-libs-prebuilt-x86_64-mac-gcc-static-v20211224205921.zip +source_hash = b83ad4162d9443bcb22413d2f6107f2a3f479893a9901d2a4dc42993f4c2c7e5 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211022224519.wrap deleted file mode 100644 index 87d68c6f4..000000000 --- a/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211022224519.zip -source_filename = tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211022224519.zip -source_hash = 72b4c8bcdfe37861326999d394f7fa10093961e2e5de9d59a41a8e323ba009f7 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921.wrap new file mode 100644 index 000000000..e77588642 --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921.zip +source_filename = tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921.zip +source_hash = 8fa1313574d8cb5a69ca5e05da299885295cc9f205164725d517e2ee762d7cca diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211022224519.wrap deleted file mode 100644 index 875feedde..000000000 --- a/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-x86_64-win-mingw-static-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211022224519.zip -source_filename = tpt-libs-prebuilt-x86_64-win-mingw-static-v20211022224519.zip -source_hash = fc0abc52e15f6f3b919fd793a03503e7c1a69465318be9659576f1dfca9ffbd2 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211224205921.wrap new file mode 100644 index 000000000..95d8651cc --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-x86_64-win-mingw-static-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-win-mingw-static-v20211224205921.zip +source_filename = tpt-libs-prebuilt-x86_64-win-mingw-static-v20211224205921.zip +source_hash = 4ce448c60122606f942cf8fb25c66e442879390e6cd8ad23eaa3c3780b9c54fc diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211022224519.wrap deleted file mode 100644 index 5193fe139..000000000 --- a/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211022224519.zip -source_filename = tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211022224519.zip -source_hash = 3c28326015e98efe60d178661657dcf56d65c883d95e3cd043943fe55c51ff85 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211224205921.wrap new file mode 100644 index 000000000..05cb2885c --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211224205921.zip +source_filename = tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20211224205921.zip +source_hash = 190af54e3b9433c4d7adfd4069ee1768e91aeea917e726087bb15989a93dedd8 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211022224519.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211022224519.wrap deleted file mode 100644 index 3851a991c..000000000 --- a/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211022224519.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-file] -directory = tpt-libs-prebuilt-x86_64-win-msvc-static-v20211022224519 - -source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211022224519/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211022224519.zip -source_filename = tpt-libs-prebuilt-x86_64-win-msvc-static-v20211022224519.zip -source_hash = 5982c4408d06649517761a21ec86bae49fd351b1a553b01e99d1afa10f127713 diff --git a/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211224205921.wrap b/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211224205921.wrap new file mode 100644 index 000000000..3b6f9e496 --- /dev/null +++ b/subprojects/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211224205921.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = tpt-libs-prebuilt-x86_64-win-msvc-static-v20211224205921 + +source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-win-msvc-static-v20211224205921.zip +source_filename = tpt-libs-prebuilt-x86_64-win-msvc-static-v20211224205921.zip +source_hash = 1faaf30a96b29cd6255f6f2919b1e14b81ad5e5a95ec37854b6273b5020cd572