This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new fa51ea2c3c Put options before objects when compiling (#18656)
fa51ea2c3c is described below
commit fa51ea2c3c9d6ccf767bffe3cfaaf2ab33771250
Author: Yichen Yan <[email protected]>
AuthorDate: Sun Jan 11 22:03:07 2026 +0800
Put options before objects when compiling (#18656)
This change is part of https://github.com/tile-ai/tvm/pull/21.
On darwin platform, when trying to compile a `.c` file as objective-c,
`-x objective-c++` needs to be prior to source files in command line
arguments. Without this PR, it's not straightforward to do so.
---
python/tvm/contrib/cc.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/tvm/contrib/cc.py b/python/tvm/contrib/cc.py
index e4a9ae2e20..bd35834535 100644
--- a/python/tvm/contrib/cc.py
+++ b/python/tvm/contrib/cc.py
@@ -348,12 +348,12 @@ def _linux_compile(
if compile_shared or output.endswith(".so") or
output.endswith(".dylib"):
cmd += ["-shared"]
cmd += ["-o", output]
+ if options:
+ cmd += options
if isinstance(objects, str):
cmd += [objects]
else:
cmd += objects
- if options:
- cmd += options
env = None
if ccache_env is not None:
if shutil.which("ccache"):