-
-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
target:set
not working correctly for arch
and toolchains
#1135
Comments
oh, I need improve toolchain and rule. Please wait some time. |
You can update to dev version and try it. (download dev installer from https://github.com/xmake-io/xmake/actions/runs/415756225 and need wait ci finished) add_rules("mode.debug", "mode.release")
set_config("vs", "2005")
rule("matching")
before_load(function (target)
-- Windows x86
target:set("arch", "x86")
target:set("toolchains", "nasm", "msvc")
-- set Windows Vista as the minimum Windows version
target:add("defines", "_WIN32_WINNT=0x0600")
-- link necessary system libraries
target:add("syslinks", "user32", "ole32")
-- statically link the C Runtime
if is_mode("debug") then
target:add("cxflags", "/MTd")
else
target:add("cxflags", "/MT")
end
end)
target("testvs")
set_kind("binary")
add_files("src/*.cpp", "src/*.asm")
-- only matching builds for now
add_rules("matching")
We need to add the nasm toolchain first to override msvc (as) program.
Currently, we only support global setting vs version, maybe I will improve it later. |
The command line parameter currently only supports one |
Can this be dynamic with some sort of config option? |
? |
For now, can I use some sort of |
Currently set_config does not support option, I need to improve set_toolchains to support vs version setting. |
I am improving toolchain to better support the configuration vs version. |
I have supported to set vs version on toochain branch. You can try it again. Please update to toolchain branch. xmake update -s toolchain try this: rule("matching")
before_load(function (target)
target:set("toolchains", "nasm", "msvc", {vs = 2015})
end I will merge this patch to dev branch if it works. |
I continue to improve toolchain branch. you can try it again. |
I have merged into dev branch. |
Alright. Sorry for the late response, I've been incredibly busy: -- add the default rules for the different compilation modes
add_rules("mode.debug", "mode.release", "mode.releasedbg")
-- create a default rule for matching compilation
rule("matching")
before_load(function (target)
-- Windows x86
target:set("plat", "windows")
target:set("arch", "x86")
-- use MSVC 2005 and NASM
target:set("toolchains", "nasm", "msvc", {vs = 2005})
-- set Windows Vista as the minimum Windows version
target:add("defines", "_WIN32_WINNT=0x0600")
-- link necessary system libraries
target:add("syslinks", "user32", "ole32")
-- statically link the C Runtime
if is_mode("debug") then
target:add("cxflags", "/MTd")
else
target:add("cxflags", "/MT")
end
end)
target("LEGOStarWarsSaga")
set_kind("binary")
-- only matching builds for now
add_rules("matching") This creates the output:
So, it doesn't even look for VS2005. It breaks on
|
my mistake, try string |
|
Describe the bug
Create a ruleset like so:
Create a target that uses the ruleset:
Expected behavior
Running
xmake
from a clean directory should build properly, using NASM to build the assembly and VS 2005 to build the C++.Error output
Even though
clang
was not a desired toolchain.Related Environment
Please provide compiling and running environment information:
xmake v2.3.9+202012081639
Additional context
Setting
vs
,arch
,plat
, andtoolchain
viaxmake f
has the following output:Then an
xmake
builds the project successfully. Notice how it doesn't look for the x64 version of VS 2005.The text was updated successfully, but these errors were encountered: