From 749634a2a6e03acf435c39f78b933a01b90a7440 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 17 Jul 2019 10:26:37 -0400 Subject: Slang -> C++ -> SharedLibrary -> Test (#999) * WIP: Adding support for C/C++ compilation to slang API. * Removed BackEndType in test harness -> use SlangPassThrough to identify backends Only require stage for targets that require it. Detection of all different backends. * Windows/Unix create temporary filename. * WIP: Output CPU binaries. * Added a pass-through c/c++ test. * Compile C++/C and store in temporary file. * Read the binary back into memory. * Set debug info and optimization flags for C/C++. Make the CPPCompiler debug/optimization levels match slangs. * Handling of include paths and math precision. * Dumping c++/c source and exe/shared library. * Put hex dump into own util. * End to end pass through c compilation test. * WIP: Simple execute test working on Linux/Unix. * Fix typo on linux. * WIP: To compile slang to cpp shared library. Report backend compiler errors. * Compiles slang -> cpp and loads as shared library. * Fix problem on c-cross-compile test because prelude is now included with <> quotes. * Run slang generated cpp code - using hard coded data. * Added cpp-execute-simple, and test output. * Fix warning that broke win32 build. * Fix compilation problem on osx. --- source/slang/slang-emit-cpp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-emit-cpp.cpp') diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index e89268106..354a2d856 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -1399,7 +1399,7 @@ void CPPSourceEmitter::emitEntryPointAttributesImpl(IRFunc* irFunc, EntryPointLa default: break; } - m_writer->emit("SLANG_EXPORT\n"); + m_writer->emit("SLANG_PRELUDE_EXPORT\n"); } void CPPSourceEmitter::emitVectorTypeNameImpl(IRType* elementType, IRIntegerValue elementCount) @@ -1613,7 +1613,8 @@ void CPPSourceEmitter::emitPreprocessorDirectivesImpl() SourceWriter* writer = getSourceWriter(); writer->emit("\n"); - writer->emit("#include \"slang-cpp-prelude.h\"\n\n"); + + writer->emit("#include \n\n"); // Emit the type definitions for (const auto& keyValue : m_typeNameMap) -- cgit v1.2.3