Skip to content

Instantly share code, notes, and snippets.

@armornick
Created December 9, 2012 19:38
Show Gist options
  • Save armornick/4246675 to your computer and use it in GitHub Desktop.
Save armornick/4246675 to your computer and use it in GitHub Desktop.
HxCpp config for Mingw
<!--
This file will get included twice - once at the beginning - once at the end.
The first time though, the "vars" section is parsed, and this is where you can
set variables to control the setup of the standard compilers and install paths etc.
The second time, the "exes" section is parsed, and you can modify the linkers/compilers
by adding flags to these executables.
-->
<xml>
<!-- This section is parses at the beginning of the build .... -->
<section id="vars">
<!-- Use this to control the SDK used when compiling for iphone/iphonesim, and the
default is not found, or you wish to use a specific version -->
<!-- <set name="IPHONE_VER" value="4.2" /> -->
<!-- If you put all your SDKs in one directory, then you can just set this
single variable. If you put them in exactly this place, then you should not
need to setup anything ! -->
<set name="SDK_ROOT" value="c:\SDKs\" unless="SDK_ROOT" if="windows" />
<set name="SDK_ROOT" value="${HOME}/SDKs/" unless="SDK_ROOT" />
<!-- ANDROID_NDK_ROOT is required for building android binaries. See:
http://developer.android.com/sdk/ndk/index.html -->
<set name="ANDROID_NDK_ROOT" value="${SDK_ROOT}/android-ndk-r6" unless="ANDROID_NDK_ROOT" />
<!-- ant is required to build android packages. See:
http://ant.apache.org/bindownload.cgi -->
<set name="ANT_HOME" value="${SDK_ROOT}/ant" unless="ANT_HOME" />
<!-- The ANDROID_SDK is required for building androis packages. See
http://developer.android.com/sdk/index.html -->
<set name="ANDROID_SDK" value="${SDK_ROOT}/android-sdk" unless="ANDROID_SDK" />
<!-- The Java development kit (which should include the java runtime) is
also required for android dev. Make sure to get the 32 bit version! -->
<set name="JAVA_HOME" value="${SDK_ROOT}/java_jdk" unless="JAVA_HOME" />
<set name="toolchain" value="mingw" />
<set name="MINGW_ROOT" value="C:/Apps/Mingw" />
<!-- If you want to control how many compilers get spawned .
The default will use the number of processors.
Reducing this to 1 can help deciphering error messages. -->
<!-- <set name="HXCPP_COMPILE_THREADS" value="1" /> -->
<!-- Add this if your compiler does not support precompiled headers -->
<!-- <set name="NO_PRECOMPILED_HEADERS" value="1"/> -->
<set name="NO_PRECOMPILED_HEADERS" value="1"/>
<!-- Older versions of gcc do not suport the @file syntax for an obj file list
and precompiled headers. Set this if you have these issues -->
<!-- <set name="GCC_OLD" value="1" /> -->
<!-- Skip the "stripping" phase. This will leave extra symbols in you exe, which
may allow reverse engineering and larger file sizes. You might want to do
this to debug some problems though. -->
<!-- <set name="nostrip" value="1" /> -->
<!-- Let the system detect the latest version of MSVC on windows
(otherwise must setup the environment yourself) -->
<!-- Disable with <set name="NO_AUTO_MSVC" value="1" /> -->
<!-- To disable specific versions: <setenv name="VS110COMNTOOLS" value="disable" /> -->
</section>
<!-- Use this section to add flags to the compilers and linkers -->
<section id="exes">
<!-- Linking on windows ... -->
<linker id="dll" if="windows">
<!-- Add library paths for windows (DirectX needed for building NME) -->
<!-- <flag value = "-libpath:e:\VS8\DirectXSDK\Lib\x86"/> -->
<!--<flag value = "-libpath:e:/VS8/PlatformSDK/Lib"/> -->
<flag value = "-static-libgcc"/>
<flag value = "-static-libstdc++" />
</linker>
<!-- And for linking executables -->
<linker id="exe" if="windows">
<!--<flag value = "-libpath:e:/VS8/PlatformSDK/Lib"/> -->
<flag value = "-static-libgcc" />
<flag value = "-static-libstdc++" />
</linker>
</section>
<!--
TO MAKE MINGW WORK:
At first I get an error on hxcpp2,10srchxStdLibs.cpp, on this instruction
at line 303.
I have to change from:
__int64 big_int = __int64(x);
to:
__int64 big_int = (__int64)(x);
Then compilation perfectly works on mingw. Anyway, I don't know cpp very well, so I'm asking someone whith better knowledge of the code base to confirm the correction is ok
-->
</xml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment