| ... | @@ -1773,8 +1773,16 @@ fn buildOutputType( | ... | @@ -1773,8 +1773,16 @@ fn buildOutputType( |
| 1773 | error.SemanticAnalyzeFail => process.exit(1), | 1773 | error.SemanticAnalyzeFail => process.exit(1), |
| 1774 | else => |e| return e, | 1774 | else => |e| return e, |
| 1775 | }; | 1775 | }; |
| 1776 | if (output_mode == .Exe) { | 1776 | switch (output_mode) { |
| 1777 | try comp.makeBinFileExecutable(); | 1777 | .Exe => try comp.makeBinFileExecutable(), |
| | 1778 | .Lib => { |
| | 1779 | if (link_mode) |lm| { |
| | 1780 | if (lm == .Dynamic) { |
| | 1781 | try comp.makeBinFileExecutable(); |
| | 1782 | } |
| | 1783 | } |
| | 1784 | }, |
| | 1785 | else => {}, |
| 1778 | } | 1786 | } |
| 1779 | | 1787 | |
| 1780 | if (build_options.is_stage1 and comp.stage1_lock != null and watch) { | 1788 | if (build_options.is_stage1 and comp.stage1_lock != null and watch) { |
| ... | @@ -2413,6 +2421,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v | ... | @@ -2413,6 +2421,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v |
| 2413 | defer comp.destroy(); | 2421 | defer comp.destroy(); |
| 2414 | | 2422 | |
| 2415 | try updateModule(gpa, comp, null, .none); | 2423 | try updateModule(gpa, comp, null, .none); |
| | 2424 | try comp.makeBinFileExecutable(); |
| 2416 | | 2425 | |
| 2417 | child_argv.items[argv_index_exe] = try comp.bin_file.options.emit.?.directory.join( | 2426 | child_argv.items[argv_index_exe] = try comp.bin_file.options.emit.?.directory.join( |
| 2418 | arena, | 2427 | arena, |