Skip to content

Commit

Permalink
Added -fPIC flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sinnwrig committed Jul 9, 2024
1 parent bf01738 commit 4da5ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub fn build(b: *Build) !void {
try cppflags.append("-std=c++17");

const base_flags = &.{
"-fPIC",
"-Wno-unused-command-line-argument",
"-Wno-unused-variable",
"-Wno-missing-exception-spec",
Expand Down Expand Up @@ -315,7 +316,7 @@ fn buildShared(b: *Build, lib: *Build.Step.Compile, optimize: std.builtin.Optimi

sharedlib.addCSourceFile(.{
.file = b.path("src/shared_main.cpp"),
.flags = &.{ "-std=c++17" },
.flags = &.{ "-std=c++17", "-fPIC" },
});

const shared_install_step = b.step("machdxcompiler", "Build and install the machdxcompiler shared library");
Expand Down

0 comments on commit 4da5ab0

Please sign in to comment.