Skip to content

Commit

Permalink
update configure
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 17, 2023
1 parent 9a42642 commit bfee48f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
}
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit bfee48f

Please sign in to comment.