Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,19 @@ jobs:
lime create SimpleAudio -verbose -nocolor
lime build SimpleAudio windows -release -verbose -nocolor
- name: Rebuild Lime (Windows, Mingw)
run: |
rm ndll/Windows64/*
lime rebuild windows -Dmingw -D MINGW_ROOT=C:\mingw64 -64 -clean -release -nocolor -verbose -nocffi
- uses: actions/upload-artifact@v4
with:
name: Windows64-MinGW-NDLL
path: |
ndll/Windows64/
!**/.gitignore
if-no-files-found: error

android:
runs-on: ubuntu-22.04
strategy:
Expand Down
5 changes: 4 additions & 1 deletion project/Build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,14 @@
<lib name="comdlg32.lib" />
<lib name="setupapi.lib" />

<lib name="bcrypt.lib" if="LIME_CURL" />

<lib name="usp10.lib" if="LIME_HARFBUZZ" />
<lib name="rpcrt4.lib" if="LIME_HARFBUZZ" />
<lib name="dwrite.lib" if="LIME_HARFBUZZ" />

<lib name="comsuppw.lib" unless="winrt" />
<lib name="comsuppw.lib" unless="winrt || mingw" />
<lib name="wbemuuid.lib" />

<lib name="D3D11.lib" if="winrt" />
<lib name="RuntimeObject.lib" if="winrt" />
Expand Down
2 changes: 1 addition & 1 deletion project/include/system/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace lime {
}


#ifndef HX_WINDOWS
#if !defined(HX_WINDOWS) || defined(__MINGW32__)
#include <stdint.h>
#else

Expand Down
6 changes: 4 additions & 2 deletions project/lib/custom/cairo/configs/windows/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@
// #define CAIRO_HAS_DLSYM 1


#ifdef __MINGW32__
// #define HAVE_BYTESWAP_H 1
// #define HAVE_INTTYPES_H 1
// #define HAVE_STDINT_H 1
#define HAVE_STDINT_H 1
// #define HAVE_SYS_INT_TYPES_H 1
// #define HAVE_UNISTD_H 1
// #define HAVE_UINT128_T 1
// #define HAVE_UINT64_T 1
#define HAVE_UINT64_T 1
#endif


// #define HAVE_INTEL_ATOMIC_PRIMITIVES 1
Expand Down
5 changes: 0 additions & 5 deletions project/lib/custom/openal/include/config-windows-x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@

#include <math.h>

#ifndef isfinite
#include <float.h>
#define isfinite _finite
#endif

/* Define a restrict macro for non-aliased pointers */
#define RESTRICT __restrict

Expand Down
8 changes: 4 additions & 4 deletions project/lib/harfbuzz-files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

<compilerflag value="-DHAVE_UNISCRIBE" if="windows" />
<compilerflag value="-DHAVE_DIRECTWRITE" if="windows HXCPP_M64" /> <!-- Windows 7+ -->
<compilerflag value="-wd4244" if="windows" />
<compilerflag value="-wd4267" if="windows" />
<compilerflag value="-D_CRT_SECURE_NO_WARNINGS" if="windows" />
<compilerflag value="-D_CRT_NONSTDC_NO_WARNINGS" if="windows" />
<compilerflag value="-wd4244" if="isMsvc" />
<compilerflag value="-wd4267" if="isMsvc" />
<compilerflag value="-D_CRT_SECURE_NO_WARNINGS" if="isMsvc" />
<compilerflag value="-D_CRT_NONSTDC_NO_WARNINGS" if="isMsvc" />

<compilerflag value="-DHAVE_CORETEXT" if="mac || ios" />
<compilerflag value="-Wno-undefined-bool-conversion" if="mac" />
Expand Down
23 changes: 9 additions & 14 deletions project/lib/openal-files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/strutils.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/threads.cpp" />

<compilerflag value="-mmmx" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse2" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse3" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-mssse3" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />

<section if="NATIVE_TOOLKIT_HAVE_SDL">

<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/custom/sdl/include/" />
Expand All @@ -100,11 +106,6 @@

<compilerflag value="-D_POSIX_C_SOURCE=200112L" />
<compilerflag value="-D_XOPEN_SOURCE=500" />
<compilerflag value="-mmmx" unless="rpi" />
<compilerflag value="-msse" unless="rpi" />
<compilerflag value="-msse2" unless="rpi" />
<compilerflag value="-msse3" unless="rpi" />
<compilerflag value="-mssse3" unless="rpi" />
<compilerflag value="-mfpu=neon" if="rpi" unless="HXCPP_ARM64" />
<compilerflag value="-fcommon" />

Expand All @@ -118,12 +119,6 @@

<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/coreaudio.cpp" />

<compilerflag value="-mmmx" unless="HXCPP_ARM64" />
<compilerflag value="-msse" unless="HXCPP_ARM64" />
<compilerflag value="-msse2" unless="HXCPP_ARM64" />
<compilerflag value="-msse3" unless="HXCPP_ARM64" />
<compilerflag value="-mssse3" unless="HXCPP_ARM64" />

</section>

<section if="windows">
Expand All @@ -138,9 +133,9 @@
<compilerflag value="-D_WIN32" />
<compilerflag value="-D_WIN32_WINNT=0x0502" />
<compilerflag value="-Drestrict=" />
<compilerflag value="-D_CRT_SECURE_NO_WARNINGS" />
<compilerflag value="-D_CRT_NONSTDC_NO_DEPRECATE" />
<compilerflag value="/wd4098" />
<compilerflag value="-D_CRT_SECURE_NO_WARNINGS" if="isMsvc" />
<compilerflag value="-D_CRT_NONSTDC_NO_DEPRECATE" if="isMsvc" />
<compilerflag value="-wd4098" if="isMsvc" />
<compilerflag value="-Dstrcasecmp=_stricmp" />
<compilerflag value="-Dstrncasecmp=_strnicmp" />

Expand Down
10 changes: 5 additions & 5 deletions project/lib/pixman-files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

<compilerflag value="-I${ANDROID_NDK_ROOT}/sources/android/cpufeatures" if="android" />

<compilerflag value="-mmmx" if="linux || mac" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse" if="linux || mac" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse2" if="linux || mac" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse3" if="linux || mac" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-mssse3" if="linux || mac" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-mmmx" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse2" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-msse3" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />
<compilerflag value="-mssse3" if="linux || mac || mingw" unless="rpi || HXCPP_ARM64" />

<compilerflag value="-Wno-attributes" if="android" />
<compilerflag value="-Wno-tautological-constant-out-of-range-compare" if="mac || ios || tvos" />
Expand Down
2 changes: 1 addition & 1 deletion project/src/backend/sdl/SDLWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#ifdef HX_WINDOWS
#include <SDL_syswm.h>
#include <Windows.h>
#include <windows.h>
#undef CreateWindow
#endif

Expand Down
2 changes: 1 addition & 1 deletion project/src/graphics/opengl/OpenGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
//#define LIME_GLES3_API
#include <windows.h>
#ifndef NATIVE_TOOLKIT_SDL_ANGLE
#include <gl/GL.h>
#include <GL/gl.h>
#endif

// typedef ptrdiff_t GLsizeiptrARB;
Expand Down
14 changes: 7 additions & 7 deletions project/src/system/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <wbemidl.h>
#include <comutil.h>
#pragma comment(lib, "wbemuuid.lib")
#include <Windows.h>
#include <windows.h>
#endif

#include <system/System.h>
Expand Down Expand Up @@ -124,7 +124,7 @@ namespace lime {

}

hres = pSvc->ExecQuery (bstr_t ("WQL"), query, WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);
hres = pSvc->ExecQuery (bstr_t (L"WQL"), query, WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);

if (FAILED (hres)) {

Expand Down Expand Up @@ -164,7 +164,7 @@ namespace lime {
std::wstring* System::GetDeviceModel () {

#if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_ComputerSystemProduct"), L"Version");
return GetWMIValue (bstr_t (L"SELECT * FROM Win32_ComputerSystemProduct"), bstr_t (L"Version"));
#endif

return NULL;
Expand All @@ -175,7 +175,7 @@ namespace lime {
std::wstring* System::GetDeviceVendor () {

#if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_ComputerSystemProduct"), L"Vendor");
return GetWMIValue (bstr_t (L"SELECT * FROM Win32_ComputerSystemProduct"), bstr_t (L"Vendor"));
#endif

return NULL;
Expand All @@ -186,7 +186,7 @@ namespace lime {
std::wstring* System::GetPlatformLabel () {

#if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_OperatingSystem"), L"Caption");
return GetWMIValue (bstr_t (L"SELECT * FROM Win32_OperatingSystem"), bstr_t (L"Caption"));
#endif

return NULL;
Expand All @@ -204,7 +204,7 @@ namespace lime {
std::wstring* System::GetPlatformVersion () {

#if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_OperatingSystem"), L"Version");
return GetWMIValue (bstr_t (L"SELECT * FROM Win32_OperatingSystem"), bstr_t (L"Version"));
#endif

return NULL;
Expand Down Expand Up @@ -420,4 +420,4 @@ size_t _mbsrtowcs(wchar_t * ws, const char **src, size_t wn, mbstate_t *st)
return -1;
}

#endif
#endif
5 changes: 4 additions & 1 deletion templates/cpp/static/BuildMain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<include name="${HXCPP}/build-tool/BuildCommon.xml" />

<set name="no_shared_libs" value="1" if="mingw" />

<include name="${HXCPP}/project/thirdparty/mbedtls-files.xml" noerror="true" />
<set name="HAS_HXCPP_MBEDTLS_FILES" value="1" if="MBEDTLS_DIR" />
<include name="${HXCPP}/src/hx/libs/ssl/Build.xml" unless="HAS_HXCPP_MBEDTLS_FILES" />
Expand Down Expand Up @@ -36,7 +38,8 @@
<lib name="wldap32.lib" />
<lib name="shell32.lib" />
<lib name="comdlg32.lib" />
<lib name="comsuppw.lib" />
<lib name="wbemuuid.lib" />
<lib name="comsuppw.lib" unless="mingw" />
<lib name="usp10.lib" />
<lib name="rpcrt4.lib" />
<lib name="dwrite.lib" />
Expand Down
6 changes: 3 additions & 3 deletions tools/platforms/WindowsPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ class WindowsPlatform extends PlatformTarget

if (!targetFlags.exists("32") && !targetFlags.exists("x86_32")
&& System.hostArchitecture == X64
&& (command != "rebuild" || targetType == "cpp" || targetType == "winrt"))
&& (command != "rebuild" || targetType == "cpp" || targetType == "neko" || targetType == "winrt"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lime rebuild neko should include 64 bit by default (on most systems at least) so I think this change makes sense anyway. I thought about changing the 32 bit check above, but that means lime build neko -rebuild won't give 32 bit binaries which is a problem if the neko installation is 32 bit.

I think this part probably needs cleaning up but that's outside the scope of this PR, so I'll leave it like this for now.

{
if (targetType == "winrt")
{
Expand Down Expand Up @@ -986,12 +986,12 @@ class WindowsPlatform extends PlatformTarget

var msvc19 = true;

if ((!hasVSCommunity && vs140 == null) || (hxcppMSVC != null && hxcppMSVC != vs140))
if (project.defines.exists("mingw") || (!hasVSCommunity && vs140 == null) || (hxcppMSVC != null && hxcppMSVC != vs140))
{
msvc19 = false;
}

var suffix = (msvc19 ? "-19.lib" : ".lib");
var suffix = (msvc19 ? "-19" : "") + "${LIBEXT}";

for (i in 0...project.ndlls.length)
{
Expand Down
Loading