From 00e3feef0186e856b737c44169e310a67d10cd7b Mon Sep 17 00:00:00 2001 From: Kai Angulo Date: Mon, 3 Jun 2024 02:32:32 -0700 Subject: [PATCH] removed -rdynamic flag --- SPIRV/CInterface/spirv_c_interface.cpp | 8 ++++++++ build.zig | 11 +++-------- glslang/CInterface/glslang_c_interface.cpp | 8 ++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/SPIRV/CInterface/spirv_c_interface.cpp b/SPIRV/CInterface/spirv_c_interface.cpp index 220ffb52..240a0aaf 100644 --- a/SPIRV/CInterface/spirv_c_interface.cpp +++ b/SPIRV/CInterface/spirv_c_interface.cpp @@ -84,6 +84,10 @@ static EShLanguage c_shader_stage(glslang_stage_t stage) return EShLangCount; } +#ifdef __cplusplus +extern "C" { +#endif + GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage) { glslang_spv_options_t spv_options {}; @@ -138,3 +142,7 @@ GLSLANG_EXPORT char* glslang_SPIRV_disassemble(const unsigned int* spv_words, si return buffer; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/build.zig b/build.zig index f013fa1e..ed530975 100644 --- a/build.zig +++ b/build.zig @@ -28,10 +28,6 @@ pub fn build(b: *Build) !void { try cppflags.append("-g0"); } - if (tag == .windows and shared) { - try cppflags.append("-rdynamic"); - } - try cppflags.append("-std=c++17"); const base_flags = &.{ @@ -77,6 +73,8 @@ pub fn build(b: *Build) !void { .debug = debug, .shared = shared_tools, .header_path = path, + .no_link = true, + .no_reduce = true, })) |dep| { tools_lib = dep.artifact("SPIRV-Tools"); tools_opt = dep.artifact("SPIRV-Tools-opt"); @@ -180,10 +178,6 @@ pub fn build(b: *Build) !void { .target = target, }); - if (shared) { - glslang_exe.defineCMacro("GLSLANG_IS_SHARED_LIBRARY", ""); - } - const install_glslang_step = b.step("glslang-standalone", "Build and install glslang.exe"); install_glslang_step.dependOn(&b.addInstallArtifact(glslang_exe, .{}).step); glslang_exe.addCSourceFiles(.{ @@ -247,6 +241,7 @@ pub fn build(b: *Build) !void { fn addIncludes(step: *std.Build.Step.Compile) void { step.addIncludePath(.{ .path = sdkPath("/" ++ output_path) }); step.addIncludePath(.{ .path = sdkPath("/") }); + step.addIncludePath(.{ .path = sdkPath("/External/spirv-tools/include") }); } fn ensureCommandExists(allocator: std.mem.Allocator, name: []const u8, exist_check: []const u8) bool { diff --git a/glslang/CInterface/glslang_c_interface.cpp b/glslang/CInterface/glslang_c_interface.cpp index 0fb6f035..c115df2f 100644 --- a/glslang/CInterface/glslang_c_interface.cpp +++ b/glslang/CInterface/glslang_c_interface.cpp @@ -141,6 +141,10 @@ private: void* context; }; +#ifdef __cplusplus +extern "C" { +#endif + GLSLANG_EXPORT int glslang_initialize_process() { return static_cast(glslang::InitializeProcess()); } GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); } @@ -480,3 +484,7 @@ GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* { return program->program->getInfoDebugLog(); } + +#ifdef __cplusplus +} +#endif \ No newline at end of file