Skip to content

Commit aabddb1

Browse files
committed
[tools] Add HXCPP_NO_VENDORED flag for system libs
1 parent 596b6e0 commit aabddb1

4 files changed

Lines changed: 30 additions & 11 deletions

File tree

src/hx/libs/regexp/Build.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,23 @@
3131
<depend name="${this_dir}/Build.xml" dateOnly="true" />
3232
<cache value="true" asLibrary="true" />
3333

34-
<compilerflag value="-I${PCRE_DIR}"/>
34+
<compilerflag value="-I${PCRE_DIR}" unless="HXCPP_NO_VENDORED" />
3535

3636
<file name="${this_dir}/RegExp.cpp"/>
3737
</files>
3838

3939
<target id="haxe">
4040
<files id="hxcpp_regexp" />
41-
<files id="pcre2-8" />
42-
<files id="pcre2-16" if="hxcpp_smart_strings" />
41+
42+
<section unless="HXCPP_NO_VENDORED">
43+
<files id="pcre2-8" />
44+
<files id="pcre2-16" if="hxcpp_smart_strings" />
45+
</section>
46+
47+
<section if="HXCPP_NO_VENDORED" unless="static_link">
48+
<lib name="-lpcre2-8" />
49+
<lib name="-lpcre2-16" if="hxcpp_smart_strings" />
50+
</section>
4351
</target>
4452

4553
</xml>

src/hx/libs/sqlite/Build.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@
99
<depend name="${this_dir}/Build.xml" dateOnly="true" />
1010
<cache value="true" asLibrary="true" />
1111

12-
<compilerflag value="-I${SQLITE_DIR}"/>
13-
1412
<file name="Sqlite.cpp"/>
1513

16-
<depend name="${SQLITE_DIR}/sqlite3.h" />
17-
<file name="${SQLITE_DIR}/sqlite3.c" tags="" />
14+
<section unless="HXCPP_NO_VENDORED" >
15+
<compilerflag value="-I${SQLITE_DIR}" unless="HXCPP_NO_VENDORED" />
16+
17+
<depend name="${SQLITE_DIR}/sqlite3.h" />
18+
<file name="${SQLITE_DIR}/sqlite3.c" tags="" />
19+
</section>
20+
1821
</files>
1922

2023
<target id="haxe">
2124
<files id="hxcpp_sqlite"/>
25+
<lib name="-lsqlite3" if="HXCPP_NO_VENDORED" unless="static_link" />
2226
<lib name="-lpthread" if="linux" unless="static_link" />
2327
</target>
2428

src/hx/libs/ssl/Build.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@
99
<depend name="${this_dir}/Build.xml" dateOnly="true" />
1010
<cache value="true" asLibrary="true" />
1111

12-
<include name="${HXCPP}/project/thirdparty/mbedtls-flags.xml" />
12+
<include name="${HXCPP}/project/thirdparty/mbedtls-flags.xml" unless="HXCPP_NO_VENDORED" />
1313

1414
<file name="${this_dir}/SSL.cpp"/>
1515
</files>
1616

1717
<target id="haxe">
1818
<!-- the order is important, mbedtls needs to come after hxcpp_ssl -->
1919
<files id="hxcpp_ssl" />
20-
<files id="mbedtls" />
20+
<files id="mbedtls" unless="HXCPP_NO_VENDORED" />
21+
22+
<section if="HXCPP_NO_VENDORED" unless="static_link">
23+
<lib name="-lmbedx509" />
24+
<lib name="-lmbedtls" />
25+
<lib name="-lmbedcrypto" />
26+
</section>
2127

2228
<lib name="advapi32.lib" if="windows" unless="static_link" />
2329
<lib name="crypt32.lib" if="windows" unless="static_link" />

src/hx/zip/zlib/Build.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<cache value="true" asLibrary="true" />
4040
<addTwice value="1" />
4141

42-
<compilerflag value="-I${ZLIB_DIR}"/>
42+
<compilerflag value="-I${ZLIB_DIR}" unless="HXCPP_NO_VENDORED" />
4343
<compilerflag value="-I${this_dir}"/>
4444

4545
<file name="ZLibUncompress.cpp"/>
@@ -48,7 +48,8 @@
4848

4949
<target id="haxe">
5050
<files id="hxcpp_zlib_impl" />
51-
<files id="zlib_sources" unless="HXCPP_LINK_NO_ZLIB"/>
51+
<files id="zlib_sources" unless="HXCPP_LINK_NO_ZLIB || HXCPP_NO_VENDORED"/>
52+
<lib name="-lz" if="HXCPP_NO_VENDORED" unless="static_link" />
5253
</target>
5354

5455
</xml>

0 commit comments

Comments
 (0)