diff options
| author | ruki <[email protected]> | 2023-01-18 00:55:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-01-18 00:55:57 +0800 |
| commit | 72d7a6249592bed6429c2e62989f9c5eeebe8bb1 (patch) | |
| tree | e91bbedbaa4b404eb38b3f4fee8c25ba1574737b | |
| parent | 414e38a8d66df9dfff6ecf70a89b7b691808d6d9 (diff) | |
update configure
| -rwxr-xr-x | configure | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -1631,6 +1631,9 @@ _get_target_compiler_flags() { fi # get flags from environments, e.g. $CFLAGS, $CXXFLAGS + if test_nz "${CPPFLAGS}"; then + result="${result} ${CPPFLAGS}" + fi if test_eq "${flagname}" "cflags" && test_nz "${CFLAGS}"; then result="${result} ${CFLAGS}" fi @@ -3191,7 +3194,7 @@ _get_funccode() { if string_contains "${func}" "("; then code="${func}" else - code="volatile void* p${func} = (void*)&${func};" + code="typedef void (*func_t)(); volatile func_t p${func} = (func_t)${func}; while (p${func}) {break;};" fi _ret="${code}" } @@ -3297,6 +3300,18 @@ _check_cxsnippets() { compflags="${compflags} ${flags}" fi done + if test_eq "${sourcekind}" "cxx"; then + if test_nz "${CXXFLAGS}"; then + compflags="${compflags} ${CXXFLAGS}" + fi + else + if test_nz "${CFLAGS}"; then + compflags="${compflags} ${CFLAGS}" + fi + fi + if test_nz "${CPPFLAGS}"; then + compflags="${compflags} ${CPPFLAGS}" + fi _toolchain_compcmd "${sourcekind}" "${objectfile}" "${sourcefile}" "${compflags}"; local compcmd="${_ret}" if ${xmake_sh_diagnosis}; then print "> ${compcmd}" @@ -3330,6 +3345,9 @@ _check_cxsnippets() { if test_nz "${flags}"; then linkflags="${linkflags} ${flags}" fi + if test_nz "${LDFLAGS}"; then + linkflags="${linkflags} ${LDFLAGS}" + fi _toolchain_linkcmd "${toolkind}" "${binaryfile}" "${objectfile}" "${linkflags}"; local linkcmd="${_ret}" if ${xmake_sh_diagnosis}; then print "> ${linkcmd}" |
