From 1fe24d3a74a9cd51c4a025cd0e78642f3e29df79 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 14 Jun 2019 18:05:12 -0400 Subject: Runtime Shared Library compilation and testing (#985) * Removed the need for VisualStudio specific CPPCompiler Improved the version parsing for gcc/clang Removed need for slang-unix-cpp-compiler-util.cpp/.h Remove binary before compiling in the compile c tests * Moved VisualStudio calcArgs into CPPCompilerUtil - as code is not windows specific. * Set up compile time version for gcc and clang * Fix compilation on OSX - use remove instead of unlink for file deletion. * On OSX - clang uses different string format. * Removed /bin/sh invoking as not required for OSX. * First pass working testing with shared libraries. --- source/core/slang-cpp-compiler.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/core/slang-cpp-compiler.h') diff --git a/source/core/slang-cpp-compiler.h b/source/core/slang-cpp-compiler.h index 82930afd6..83c18bca2 100644 --- a/source/core/slang-cpp-compiler.h +++ b/source/core/slang-cpp-compiler.h @@ -23,6 +23,11 @@ public: GHS, CountOf, }; + enum class SourceType + { + C, ///< C source + CPP, ///< C++ source + }; struct Desc { @@ -70,9 +75,21 @@ public: struct CompileOptions { + typedef uint32_t Flags; + struct Flag + { + enum Enum : Flags + { + EnableExceptionHandling = 0x01, + }; + }; + OptimizationLevel optimizationLevel = OptimizationLevel::Debug; DebugInfoType debugInfoType = DebugInfoType::Normal; TargetType targetType = TargetType::Executable; + SourceType sourceType = SourceType::CPP; + + Flags flags = Flag::EnableExceptionHandling; String modulePath; ///< The path/name of the output module. Should not have the extension, as that will be added for each of the target types @@ -162,6 +179,7 @@ struct CPPCompilerUtil typedef CPPCompiler::OptimizationLevel OptimizationLevel; typedef CPPCompiler::TargetType TargetType; typedef CPPCompiler::DebugInfoType DebugInfoType; + typedef CPPCompiler::SourceType SourceType; enum class MatchType { -- cgit v1.2.3