@@ -10,19 +10,25 @@ rule("find_cct_pkg_generator")
1010 dir = path .join (cctPkgGen :installdir (), " bin" )
1111 else
1212 cctPkgGen = project .target (" concerto-pkg-generator" )
13- if cctPkgGen then
14- dir = cctPkgGen :targetdir ()
15- envs = cctPkgGen :get (" runenvs" )
16- if not envs and os .host () == " linux" or os .host () == " macosx" then
17- envs = {}
18- for _ , pkg in ipairs (cctPkgGen :orderpkgs ()) do
19- local installDir = path .join (pkg :installdir (), " lib" )
20- envs .LD_LIBRARY_PATH = installDir .. path .envsep () .. (envs .LD_LIBRARY_PATH or " " )
21- end
22- end
23-
13+ end
14+
15+ if cctPkgGen then
16+ dir = cctPkgGen :targetdir ()
17+ envs = cctPkgGen :get (" runenvs" )
18+ if not envs then
19+ envs = {}
20+ for _ , pkg in ipairs (cctPkgGen :orderpkgs ()) do
21+ if os .host () == " linux" or os .host () == " macosx" then
22+ local installDir = path .join (pkg :installdir (), " lib" )
23+ envs .LD_LIBRARY_PATH = installDir .. path .envsep () .. (envs .LD_LIBRARY_PATH or " " )
24+ elseif os .host () == " windows" then
25+ local installDir = path .join (pkg :installdir (), " bin" )
26+ envs .PATH = installDir .. path .envsep () .. (envs .PATH or " " )
27+ end
28+ end
2429 end
2530 end
31+ print (envs )
2632 local program = find_tool (" concerto-pkg-generator" , {version = false , paths = dir , envs = envs })
2733 target :data_set (" concerto-pkg-generator" , program )
2834 target :data_set (" concerto-pkg-generator-envs" , envs )
0 commit comments