Skip to content

Commit 48410b4

Browse files
committed
Allow cffi symbols to be hidden when static-linking. Add HXCPP_NO_IMPLIB to avoid generation of .lib and .exp files on windows. Correct typo in 'fillouput'.
1 parent 2c6b13c commit 48410b4

File tree

6 files changed

+85
-71
lines changed

6 files changed

+85
-71
lines changed

include/hx/CFFIPrime.h

Lines changed: 69 additions & 64 deletions
Large diffs are not rendered by default.

src/hx/CFFI.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,10 @@ const char16_t * hxs_utf16(const String &string,hx::IStringAlloc *alloc)
997997
}
998998

999999

1000-
EXPORT void * hx_cffi(const char *inName)
1000+
#ifndef HXCPP_STATIC_CFFI
1001+
EXPORT
1002+
#endif
1003+
void * hx_cffi(const char *inName)
10011004
{
10021005
#define HXCPP_PRIME
10031006
#define DEFFUNC(name,r,b,c) if ( !strcmp(inName,#name) ) return (void *)name;

toolchain/common-defines.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<flag value="-DHXCPP_DEBUG" if="debug" />
33
<flag value="-DSTATIC_LINK" if="static_link" tag="static" />
44
<flag value="-DHXCPP_EXE_LINK" if="exe_link" tag="static" />
5+
<flag value="-DHXCPP_STATIC_CFFI" if="HXCPP_STATIC_CFFI" tag="cffi" />
56
<flag value="-DHXCPP_ARM64" if="HXCPP_ARM64"/>
67
<flag value="-DHXCPP_ARMV7" if="HXCPP_ARMV7"/>
78
<flag value="-DHXCPP_M64" if="HXCPP_M64||HXCPP_ARM64||HXCPP_X86_64"/>

toolchain/haxe-target.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<xml>
22

33
<!-- make sure hxcpp.n is up to date -->
4-
<pleaseUpdateHxcppTool version="6" />
4+
<pleaseUpdateHxcppTool version="7" />
55

66
<pragma once="true" />
77

@@ -158,7 +158,7 @@
158158

159159
<file name = "src/hx/Anon.cpp"/>
160160
<file name = "src/hx/Boot.cpp"/>
161-
<file name = "src/hx/CFFI.cpp" tags="haxe,static" />
161+
<file name = "src/hx/CFFI.cpp" tags="haxe,static,cffi" />
162162
<file name = "src/hx/Date.cpp"/>
163163
<file name = "src/hx/gc/GcCommon.cpp" tags="haxe,gc" />
164164
<file name = "src/hx/gc/Immix.cpp" tags="haxe,gc" />
@@ -239,7 +239,8 @@
239239
<ext value="${LIBEXTRA}" if="exe_link" />
240240
</section>
241241

242-
<fullouput name="${HAXE_FULL_OUTPUT_NAME}" if="HAXE_FULL_OUTPUT_NAME" />
242+
<!-- Note: was - 'fullouput' -->
243+
<fulloutput name="${HAXE_FULL_OUTPUT_NAME}" if="HAXE_FULL_OUTPUT_NAME" />
243244
<fullunstripped name="${HAXE_FULL_UNSTRIPPED_NAME}" if="HAXE_FULL_UNSTRIPPED_NAME" />
244245

245246
<files id="__main__" unless="static_link" />

toolchain/msvc-toolchain.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
<flag value="-LTCG" if="HXCPP_OPTIMIZE_LINK" unless="debug || HXCPP_LTCG_INCREMENTAL"/>
131131
<flag value="-LTCG:INCREMENTAL" if="HXCPP_LTCG_INCREMENTAL" unless="debug"/>
132132
<flag value="-map:${HXCPP_MAP_FILE}" if="HXCPP_MAP_FILE" />
133+
<flag value="-NOIMPLIB" if="HXCPP_NO_IMPLIB" />
134+
<flag value="-NOEXP" if="HXCPP_NO_IMPLIB" />
133135
<lib name="${dll_import_link}" if="dll_import_link" />
134136
<ext value=".dll"/>
135137
<libdir name="obj/lib"/>
@@ -154,6 +156,8 @@
154156
<flag value="-LTCG:INCREMENTAL" if="HXCPP_LTCG_INCREMENTAL" unless="debug"/>
155157
<flag value="-subsystem:windows${SUBSYSTEM_VER}" if="SUBSYSTEMWINDOWS" />
156158
<flag value="-subsystem:console${SUBSYSTEM_VER}" if="SUBSYSTEMCONSOLE" />
159+
<flag value="-NOIMPLIB" if="HXCPP_NO_IMPLIB" />
160+
<flag value="-NOEXP" if="HXCPP_NO_IMPLIB" />
157161
<libpathflag value="-libpath:"/>
158162
<flag value="-libpath:lib"/>
159163
<flag value="user32.lib"/>

tools/hxcpp/BuildTool.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ class BuildTool
772772
}
773773
Profile.pop();
774774
case _ if (inDestination != null):
775-
Log.warn('Target \'${inTarget}\' does not output a file, so \'destination\' has been ignored');
775+
Log.v('Target \'${inTarget}\' does not output a file, so \'destination\' has been ignored');
776776
}
777777

778778
if (mCopyFiles.length>0)
@@ -1263,7 +1263,7 @@ class BuildTool
12631263
case "ext" : target.setExt( (substitute(el.att.value)) );
12641264
case "builddir" : target.mBuildDir = substitute(el.att.name);
12651265
case "libpath" : target.mLibPaths.push( substitute(el.att.name) );
1266-
case "fullouput" : target.mFullOutputName = substitute(el.att.name);
1266+
case "fulloutput" : target.mFullOutputName = substitute(el.att.name);
12671267
case "fullunstripped" : target.mFullUnstrippedName = substitute(el.att.name);
12681268
case "files" :
12691269
var id = el.att.id;
@@ -2361,7 +2361,7 @@ class BuildTool
23612361
public function checkToolVersion(inVersion:String)
23622362
{
23632363
var ver = Std.parseInt(inVersion);
2364-
if (ver>6)
2364+
if (ver>7)
23652365
Log.error("Your version of hxcpp.n is out-of-date. Please update by compiling 'haxe compile.hxml' in hxcpp/tools/hxcpp.");
23662366
}
23672367

0 commit comments

Comments
 (0)