├── .gitignore ├── CMakeLists.txt ├── Code ├── Core │ ├── CMakeLists.txt │ ├── Containers │ │ ├── Array.h │ │ ├── AutoPtr.h │ │ ├── Forward.h │ │ ├── Move.h │ │ ├── Singleton.h │ │ └── Sort.h │ ├── Core.natvis │ ├── Core.vcxproj │ ├── Core.vcxproj.filters │ ├── CoreTest │ │ ├── TestMain.cpp │ │ └── Tests │ │ │ ├── TestAString.cpp │ │ │ ├── TestArray.cpp │ │ │ ├── TestAtomic.cpp │ │ │ ├── TestEnv.cpp │ │ │ ├── TestFileIO.cpp │ │ │ ├── TestFileStream.cpp │ │ │ ├── TestHash.cpp │ │ │ ├── TestLevenshteinDistance.cpp │ │ │ ├── TestMemPoolBlock.cpp │ │ │ ├── TestMutex.cpp │ │ │ ├── TestPathUtils.cpp │ │ │ ├── TestReflection.cpp │ │ │ ├── TestSemaphore.cpp │ │ │ ├── TestSharedMemory.cpp │ │ │ ├── TestSmallBlockAllocator.cpp │ │ │ ├── TestSystemMutex.cpp │ │ │ ├── TestTCPConnectionPool.cpp │ │ │ └── TestTimer.cpp │ ├── Env │ │ ├── Assert.cpp │ │ ├── Assert.h │ │ ├── Env.cpp │ │ ├── Env.h │ │ ├── ErrorFormat.cpp │ │ ├── ErrorFormat.h │ │ ├── MSVCStaticAnalysis.h │ │ ├── Types.h │ │ ├── WindowsHeader.h │ │ └── glibc_compat.h │ ├── FileIO │ │ ├── ConstMemoryStream.cpp │ │ ├── ConstMemoryStream.h │ │ ├── FileIO.cpp │ │ ├── FileIO.h │ │ ├── FileStream.cpp │ │ ├── FileStream.h │ │ ├── IOStream.cpp │ │ ├── IOStream.h │ │ ├── MemoryStream.cpp │ │ ├── MemoryStream.h │ │ ├── PathUtils.cpp │ │ └── PathUtils.h │ ├── Math │ │ ├── CRC32.cpp │ │ ├── CRC32.h │ │ ├── Constants.h │ │ ├── Conversions.h │ │ ├── Random.cpp │ │ ├── Random.h │ │ ├── Trig.h │ │ └── xxHash.h │ ├── Mem │ │ ├── Mem.cpp │ │ ├── Mem.h │ │ ├── MemDebug.cpp │ │ ├── MemDebug.h │ │ ├── MemPoolBlock.cpp │ │ ├── MemPoolBlock.h │ │ ├── MemTracker.cpp │ │ ├── MemTracker.h │ │ ├── SmallBlockAllocator.cpp │ │ └── SmallBlockAllocator.h │ ├── Network │ │ ├── Network.cpp │ │ ├── Network.h │ │ ├── NetworkStartupHelper.cpp │ │ ├── NetworkStartupHelper.h │ │ ├── TCPConnectionPool.cpp │ │ └── TCPConnectionPool.h │ ├── Process │ │ ├── Atomic.h │ │ ├── Mutex.cpp │ │ ├── Mutex.h │ │ ├── Process.cpp │ │ ├── Process.h │ │ ├── Semaphore.cpp │ │ ├── Semaphore.h │ │ ├── SharedMemory.cpp │ │ ├── SharedMemory.h │ │ ├── SystemMutex.cpp │ │ ├── SystemMutex.h │ │ ├── Thread.cpp │ │ └── Thread.h │ ├── Profile │ │ ├── Profile.h │ │ ├── ProfileManager.cpp │ │ └── ProfileManager.h │ ├── Reflection │ │ ├── MetaData │ │ │ ├── MetaData.cpp │ │ │ ├── MetaData.h │ │ │ ├── MetaDataInterface.h │ │ │ ├── Meta_File.cpp │ │ │ ├── Meta_File.h │ │ │ ├── Meta_Hidden.cpp │ │ │ ├── Meta_Hidden.h │ │ │ ├── Meta_Optional.cpp │ │ │ ├── Meta_Optional.h │ │ │ ├── Meta_Path.cpp │ │ │ ├── Meta_Path.h │ │ │ ├── Meta_Range.cpp │ │ │ └── Meta_Range.h │ │ ├── Object.cpp │ │ ├── Object.h │ │ ├── PropertyType.h │ │ ├── ReflectedProperty.cpp │ │ ├── ReflectedProperty.h │ │ ├── ReflectionInfo.cpp │ │ ├── ReflectionInfo.h │ │ ├── ReflectionIter.cpp │ │ ├── ReflectionIter.h │ │ ├── ReflectionMacros.h │ │ ├── ReflectionSettings.h │ │ ├── Struct.cpp │ │ └── Struct.h │ ├── Strings │ │ ├── AStackString.h │ │ ├── AString.cpp │ │ ├── AString.h │ │ ├── LevenshteinDistance.cpp │ │ └── LevenshteinDistance.h │ ├── Time │ │ ├── Time.cpp │ │ ├── Time.h │ │ ├── Timer.cpp │ │ └── Timer.h │ ├── Tracing │ │ ├── Tracing.cpp │ │ └── Tracing.h │ └── cmake_install.cmake ├── LICENSE.TXT ├── OSUI │ ├── CMakeLists.txt │ ├── OSDropDown.cpp │ ├── OSDropDown.h │ ├── OSDropDown.mm │ ├── OSFont.cpp │ ├── OSFont.h │ ├── OSLabel.cpp │ ├── OSLabel.h │ ├── OSLabel.mm │ ├── OSListView.cpp │ ├── OSListView.h │ ├── OSListView.mm │ ├── OSMenu.cpp │ ├── OSMenu.h │ ├── OSMenu.mm │ ├── OSSplitter.cpp │ ├── OSSplitter.h │ ├── OSSplitter.mm │ ├── OSTrayIcon.cpp │ ├── OSTrayIcon.h │ ├── OSTrayIcon.mm │ ├── OSWidget.cpp │ ├── OSWidget.h │ ├── OSWindow.cpp │ ├── OSWindow.h │ └── OSWindow.mm ├── TestFramework │ ├── CMakeLists.txt │ ├── UnitTest.cpp │ ├── UnitTest.h │ ├── UnitTestManager.cpp │ └── UnitTestManager.h └── Tools │ └── FBuild │ ├── BFFFuzzer │ ├── Main.cpp │ ├── README.md │ └── bff.dict │ ├── Documentation │ ├── docs │ │ ├── abasicapplication.html │ │ ├── changelog.html │ │ ├── contact.html │ │ ├── documentation.html │ │ ├── download.html │ │ ├── environmentvariables.html │ │ ├── errors.html │ │ ├── errors │ │ │ ├── 1001.html │ │ │ ├── 1002.html │ │ │ ├── 1003.html │ │ │ ├── 1004.html │ │ │ ├── 1005.html │ │ │ ├── 1006.html │ │ │ ├── 1007.html │ │ │ ├── 1008.html │ │ │ ├── 1009.html │ │ │ ├── 1010.html │ │ │ ├── 1011.html │ │ │ ├── 1012.html │ │ │ ├── 1013.html │ │ │ ├── 1014.html │ │ │ ├── 1015.html │ │ │ ├── 1016.html │ │ │ ├── 1017.html │ │ │ ├── 1018.html │ │ │ ├── 1020.html │ │ │ ├── 1021.html │ │ │ ├── 1022.html │ │ │ ├── 1023.html │ │ │ ├── 1024.html │ │ │ ├── 1025.html │ │ │ ├── 1026.html │ │ │ ├── 1027.html │ │ │ ├── 1028.html │ │ │ ├── 1029.html │ │ │ ├── 1030.html │ │ │ ├── 1031.html │ │ │ ├── 1032.html │ │ │ ├── 1033.html │ │ │ ├── 1034.html │ │ │ ├── 1035.html │ │ │ ├── 1037.html │ │ │ ├── 1038.html │ │ │ ├── 1039.html │ │ │ ├── 1040.html │ │ │ ├── 1041.html │ │ │ ├── 1042.html │ │ │ ├── 1043.html │ │ │ ├── 1044.html │ │ │ ├── 1045.html │ │ │ ├── 1050.html │ │ │ ├── 1054.html │ │ │ ├── 1060.html │ │ │ ├── 1100.html │ │ │ ├── 1101.html │ │ │ ├── 1102.html │ │ │ ├── 1103.html │ │ │ ├── 1104.html │ │ │ ├── 1105.html │ │ │ ├── 1106.html │ │ │ ├── 1107.html │ │ │ ├── 1108.html │ │ │ ├── 1109.html │ │ │ ├── 1110.html │ │ │ ├── 1111.html │ │ │ ├── 1112.html │ │ │ ├── 1200.html │ │ │ ├── 1201.html │ │ │ ├── 1202.html │ │ │ ├── 1204.html │ │ │ ├── 1300.html │ │ │ ├── 1301.html │ │ │ ├── 1302.html │ │ │ ├── 1303.html │ │ │ ├── 1400.html │ │ │ ├── 1500.html │ │ │ ├── 1501.html │ │ │ ├── 1502.html │ │ │ ├── 1503.html │ │ │ ├── 1504.html │ │ │ └── 1999.html │ │ ├── examples │ │ │ └── helloworld_windows.html │ │ ├── fbuildexample.html │ │ ├── features.html │ │ ├── features │ │ │ ├── caching.html │ │ │ └── distribution.html │ │ ├── functions.html │ │ ├── functions │ │ │ ├── alias.html │ │ │ ├── compiler.html │ │ │ ├── copy.html │ │ │ ├── copydir.html │ │ │ ├── csassembly.html │ │ │ ├── dll.html │ │ │ ├── error.html │ │ │ ├── exec.html │ │ │ ├── executable.html │ │ │ ├── foreach.html │ │ │ ├── if.html │ │ │ ├── library.html │ │ │ ├── objectlist.html │ │ │ ├── print.html │ │ │ ├── removedir.html │ │ │ ├── settings.html │ │ │ ├── test.html │ │ │ ├── textfile.html │ │ │ ├── unity.html │ │ │ ├── using.html │ │ │ ├── vcxproject.html │ │ │ ├── vsprojectexternal.html │ │ │ ├── vssolution.html │ │ │ └── xcodeproject.html │ │ ├── home.html │ │ ├── img │ │ │ ├── bullet.png │ │ │ ├── home_timings.png │ │ │ ├── logo.png │ │ │ ├── worker_available.png │ │ │ ├── worker_available_always.png │ │ │ └── worker_connection.png │ │ ├── license.html │ │ ├── options.html │ │ ├── quickstartguide.html │ │ ├── style.css │ │ ├── syntaxguide.html │ │ └── troubleshooting │ │ │ └── distribution.html │ ├── favicon.ico │ └── index.html │ ├── FBuildApp │ ├── CMakeLists.txt │ └── Main.cpp │ ├── FBuildCore │ ├── BFF │ │ ├── BFFFile.cpp │ │ ├── BFFFile.h │ │ ├── BFFFileExists.cpp │ │ ├── BFFFileExists.h │ │ ├── BFFKeywords.h │ │ ├── BFFMacros.cpp │ │ ├── BFFMacros.h │ │ ├── BFFParser.cpp │ │ ├── BFFParser.h │ │ ├── BFFStackFrame.cpp │ │ ├── BFFStackFrame.h │ │ ├── BFFUserFunctions.cpp │ │ ├── BFFUserFunctions.h │ │ ├── BFFVariable.cpp │ │ ├── BFFVariable.h │ │ ├── Functions │ │ │ ├── Function.cpp │ │ │ ├── Function.h │ │ │ ├── FunctionAlias.cpp │ │ │ ├── FunctionAlias.h │ │ │ ├── FunctionCSAssembly.cpp │ │ │ ├── FunctionCSAssembly.h │ │ │ ├── FunctionCompiler.cpp │ │ │ ├── FunctionCompiler.h │ │ │ ├── FunctionCopy.cpp │ │ │ ├── FunctionCopy.h │ │ │ ├── FunctionCopyDir.cpp │ │ │ ├── FunctionCopyDir.h │ │ │ ├── FunctionDLL.cpp │ │ │ ├── FunctionDLL.h │ │ │ ├── FunctionError.cpp │ │ │ ├── FunctionError.h │ │ │ ├── FunctionExec.cpp │ │ │ ├── FunctionExec.h │ │ │ ├── FunctionExecutable.cpp │ │ │ ├── FunctionExecutable.h │ │ │ ├── FunctionForEach.cpp │ │ │ ├── FunctionForEach.h │ │ │ ├── FunctionIf.cpp │ │ │ ├── FunctionIf.h │ │ │ ├── FunctionLibrary.cpp │ │ │ ├── FunctionLibrary.h │ │ │ ├── FunctionObjectList.cpp │ │ │ ├── FunctionObjectList.h │ │ │ ├── FunctionPrint.cpp │ │ │ ├── FunctionPrint.h │ │ │ ├── FunctionRemoveDir.cpp │ │ │ ├── FunctionRemoveDir.h │ │ │ ├── FunctionSettings.cpp │ │ │ ├── FunctionSettings.h │ │ │ ├── FunctionTest.cpp │ │ │ ├── FunctionTest.h │ │ │ ├── FunctionTextFile.cpp │ │ │ ├── FunctionTextFile.h │ │ │ ├── FunctionUnity.cpp │ │ │ ├── FunctionUnity.h │ │ │ ├── FunctionUsing.cpp │ │ │ ├── FunctionUsing.h │ │ │ ├── FunctionVCXProject.cpp │ │ │ ├── FunctionVCXProject.h │ │ │ ├── FunctionVSProjectExternal.cpp │ │ │ ├── FunctionVSProjectExternal.h │ │ │ ├── FunctionVSSolution.cpp │ │ │ ├── FunctionVSSolution.h │ │ │ ├── FunctionXCodeProject.cpp │ │ │ └── FunctionXCodeProject.h │ │ └── Tokenizer │ │ │ ├── BFFToken.cpp │ │ │ ├── BFFToken.h │ │ │ ├── BFFToken.natvis │ │ │ ├── BFFTokenRange.h │ │ │ ├── BFFTokenizer.cpp │ │ │ └── BFFTokenizer.h │ ├── CMakeLists.txt │ ├── Cache │ │ ├── Cache.cpp │ │ ├── Cache.h │ │ ├── CachePlugin.cpp │ │ ├── CachePlugin.h │ │ ├── CachePluginInterface.h │ │ ├── ICache.cpp │ │ ├── ICache.h │ │ ├── LightCache.cpp │ │ └── LightCache.h │ ├── Error.cpp │ ├── Error.h │ ├── FBuild.cpp │ ├── FBuild.h │ ├── FBuildOptions.cpp │ ├── FBuildOptions.h │ ├── FBuildVersion.h │ ├── FLog.cpp │ ├── FLog.h │ ├── Graph │ │ ├── AliasNode.cpp │ │ ├── AliasNode.h │ │ ├── CSNode.cpp │ │ ├── CSNode.h │ │ ├── CompilerNode.cpp │ │ ├── CompilerNode.h │ │ ├── CopyDirNode.cpp │ │ ├── CopyDirNode.h │ │ ├── CopyFileNode.cpp │ │ ├── CopyFileNode.h │ │ ├── DLLNode.cpp │ │ ├── DLLNode.h │ │ ├── Dependencies.cpp │ │ ├── Dependencies.h │ │ ├── DirectoryListNode.cpp │ │ ├── DirectoryListNode.h │ │ ├── ExeNode.cpp │ │ ├── ExeNode.h │ │ ├── ExecNode.cpp │ │ ├── ExecNode.h │ │ ├── FileNode.cpp │ │ ├── FileNode.h │ │ ├── LibraryNode.cpp │ │ ├── LibraryNode.h │ │ ├── LinkerNode.cpp │ │ ├── LinkerNode.h │ │ ├── MetaData │ │ │ ├── Meta_AllowNonFile.cpp │ │ │ ├── Meta_AllowNonFile.h │ │ │ ├── Meta_EmbedMembers.cpp │ │ │ ├── Meta_EmbedMembers.h │ │ │ ├── Meta_IgnoreForComparison.cpp │ │ │ ├── Meta_IgnoreForComparison.h │ │ │ ├── Meta_InheritFromOwner.cpp │ │ │ ├── Meta_InheritFromOwner.h │ │ │ ├── Meta_Name.cpp │ │ │ └── Meta_Name.h │ │ ├── Node.cpp │ │ ├── Node.h │ │ ├── Node.natvis │ │ ├── NodeGraph.cpp │ │ ├── NodeGraph.h │ │ ├── NodeProxy.cpp │ │ ├── NodeProxy.h │ │ ├── ObjectListNode.cpp │ │ ├── ObjectListNode.h │ │ ├── ObjectNode.cpp │ │ ├── ObjectNode.h │ │ ├── RemoveDirNode.cpp │ │ ├── RemoveDirNode.h │ │ ├── SLNNode.cpp │ │ ├── SLNNode.h │ │ ├── SettingsNode.cpp │ │ ├── SettingsNode.h │ │ ├── TestNode.cpp │ │ ├── TestNode.h │ │ ├── TextFileNode.cpp │ │ ├── TextFileNode.h │ │ ├── UnityNode.cpp │ │ ├── UnityNode.h │ │ ├── VCXProjectNode.cpp │ │ ├── VCXProjectNode.h │ │ ├── VSProjLoaderInterface.h │ │ ├── VSProjectBaseNode.cpp │ │ ├── VSProjectBaseNode.h │ │ ├── VSProjectExternalNode.cpp │ │ ├── VSProjectExternalNode.h │ │ ├── XCodeProjectNode.cpp │ │ └── XCodeProjectNode.h │ ├── Helpers │ │ ├── Args.cpp │ │ ├── Args.h │ │ ├── CIncludeParser.cpp │ │ ├── CIncludeParser.h │ │ ├── CompilationDatabase.cpp │ │ ├── CompilationDatabase.h │ │ ├── Compressor.cpp │ │ ├── Compressor.h │ │ ├── CtrlCHandler.cpp │ │ ├── CtrlCHandler.h │ │ ├── FBuildStats.cpp │ │ ├── FBuildStats.h │ │ ├── MultiBuffer.cpp │ │ ├── MultiBuffer.h │ │ ├── ProjectGeneratorBase.cpp │ │ ├── ProjectGeneratorBase.h │ │ ├── Report.cpp │ │ ├── Report.h │ │ ├── ResponseFile.cpp │ │ ├── ResponseFile.h │ │ ├── SLNGenerator.cpp │ │ ├── SLNGenerator.h │ │ ├── ToolManifest.cpp │ │ ├── ToolManifest.h │ │ ├── VSProjectGenerator.cpp │ │ ├── VSProjectGenerator.h │ │ ├── XCodeProjectGenerator.cpp │ │ └── XCodeProjectGenerator.h │ ├── Protocol │ │ ├── Client.cpp │ │ ├── Client.h │ │ ├── Protocol.cpp │ │ ├── Protocol.h │ │ ├── Server.cpp │ │ └── Server.h │ └── WorkerPool │ │ ├── Job.cpp │ │ ├── Job.h │ │ ├── JobQueue.cpp │ │ ├── JobQueue.h │ │ ├── JobQueueRemote.cpp │ │ ├── JobQueueRemote.h │ │ ├── WorkerBrokerage.cpp │ │ ├── WorkerBrokerage.h │ │ ├── WorkerThread.cpp │ │ ├── WorkerThread.h │ │ ├── WorkerThreadRemote.cpp │ │ └── WorkerThreadRemote.h │ ├── FBuildTest │ ├── Data │ │ ├── TestBuildAndLinkLibrary │ │ │ ├── a.cpp │ │ │ ├── a.h │ │ │ ├── b.cpp │ │ │ ├── b.h │ │ │ ├── c.cpp │ │ │ └── c.h │ │ ├── TestCLR │ │ │ ├── a.cpp │ │ │ ├── a.h │ │ │ ├── b.cpp │ │ │ ├── c.cpp │ │ │ └── exe.cxx │ │ ├── TestCSharp │ │ │ ├── a.cs │ │ │ ├── b.cs │ │ │ ├── c.cs │ │ │ └── dummy.csnot │ │ ├── TestCUDA │ │ │ └── test.cu │ │ ├── TestCache │ │ │ ├── Analyze_MSVC │ │ │ │ ├── file1.cpp │ │ │ │ └── file2.cpp │ │ │ ├── ConsistentCacheKeys │ │ │ │ └── file1.cpp │ │ │ ├── LightCache_CyclicInclude │ │ │ │ ├── file1.cpp │ │ │ │ ├── file1.h │ │ │ │ ├── file2.cpp │ │ │ │ ├── file2.h │ │ │ │ ├── header1.h │ │ │ │ └── header2.h │ │ │ ├── LightCache_ImportDirective │ │ │ │ └── file.cpp │ │ │ ├── LightCache_IncludeHierarchy │ │ │ │ ├── Folder1 │ │ │ │ │ ├── file.cpp │ │ │ │ │ └── file.h │ │ │ │ ├── Folder2 │ │ │ │ │ ├── file.cpp │ │ │ │ │ └── file.h │ │ │ │ └── common.h │ │ │ ├── LightCache_IncludeUsingMacro │ │ │ │ ├── file.1.cpp │ │ │ │ ├── file.1.h │ │ │ │ ├── file.2.cpp │ │ │ │ ├── file.2.h │ │ │ │ └── file.h │ │ │ ├── LightCache_IncludeUsingMacro2 │ │ │ │ ├── file.1.cpp │ │ │ │ ├── file.2.cpp │ │ │ │ ├── header1.h │ │ │ │ └── header2.h │ │ │ ├── LightCache_IncludeUsingMacro3 │ │ │ │ ├── file.cpp │ │ │ │ ├── header1.h │ │ │ │ └── header2.h │ │ │ ├── a.cpp │ │ │ └── b.cpp │ │ ├── TestCachePlugin │ │ │ ├── Plugin.cpp │ │ │ └── TestA.cpp │ │ ├── TestCompilationDatabase │ │ │ ├── clang │ │ │ └── dir │ │ │ │ └── subdir │ │ │ │ └── file.cpp │ │ ├── TestCompiler │ │ │ ├── Explicit │ │ │ │ └── PlaceholderForClang │ │ │ ├── Implicit │ │ │ │ └── PlaceholderForClang │ │ │ ├── SimpleCompiler.cpp │ │ │ └── exe.cpp │ │ ├── TestCompressor │ │ │ ├── TestObjFile.o │ │ │ └── TestPreprocessedFile.ii │ │ ├── TestCopy │ │ │ ├── MissingTrailingSlash │ │ │ │ ├── a.txt │ │ │ │ └── b.txt │ │ │ ├── ObjectListChaining │ │ │ │ ├── file.1.cpp │ │ │ │ └── file.2.cpp │ │ │ ├── ObjectListChaining2 │ │ │ │ └── file.1.cpp │ │ │ ├── a.txt │ │ │ └── b.txt │ │ ├── TestDLL │ │ │ ├── PrecompiledHeader.cpp │ │ │ ├── PrecompiledHeader.h │ │ │ ├── a.cpp │ │ │ ├── a.h │ │ │ ├── b.cpp │ │ │ ├── b.h │ │ │ └── exe.cpp │ │ ├── TestDistributed │ │ │ ├── AnonymousNamespaces │ │ │ │ ├── A │ │ │ │ │ └── file.cpp │ │ │ │ └── B │ │ │ │ │ └── file.cpp │ │ │ ├── BadCode │ │ │ │ └── ErrorWithPercent.cpp │ │ │ ├── ErrorsAreCorrectlyReported │ │ │ │ └── Error.cpp │ │ │ ├── ForceInclude │ │ │ │ ├── a.cpp │ │ │ │ └── a.h │ │ │ ├── PrecompiledHeader.cpp │ │ │ ├── PrecompiledHeader.h │ │ │ ├── RemoteRaceWinRemote │ │ │ │ ├── Fast.cpp │ │ │ │ ├── Slow.cpp │ │ │ │ └── SlowTemplate.h │ │ │ ├── ShutdownMemoryLeak │ │ │ │ └── a.cpp │ │ │ ├── WarningsAreCorrectlyReported │ │ │ │ └── Warning.cpp │ │ │ ├── Zi │ │ │ │ └── a.cpp │ │ │ ├── a_normal.cpp │ │ │ ├── a_pch.cpp │ │ │ ├── b_normal.cpp │ │ │ ├── b_pch.cpp │ │ │ ├── c_normal.cpp │ │ │ └── c_pch.cpp │ │ ├── TestExe │ │ │ └── exe.cpp │ │ ├── TestExec │ │ │ └── exec.cpp │ │ ├── TestFastCancel │ │ │ └── Cancel │ │ │ │ └── main.cpp │ │ ├── TestGraph │ │ │ ├── NoStopOnFirstError │ │ │ │ ├── a.cpp │ │ │ │ ├── b.cpp │ │ │ │ ├── c.cpp │ │ │ │ └── d.cpp │ │ │ ├── library.cpp │ │ │ └── library.o │ │ ├── TestIncludeParser │ │ │ ├── MSVC-P │ │ │ │ └── test.cpp │ │ │ ├── MSVC-ShowIncludes │ │ │ │ └── WithWarnings.output │ │ │ ├── fbuildcore.clang.ii │ │ │ ├── fbuildcore.clang.ms-extensions.ii │ │ │ ├── fbuildcore.gcc.ii │ │ │ ├── fbuildcore.msvc.ii │ │ │ └── fbuildcore.msvc.showincludes │ │ ├── TestLinker │ │ │ └── LibrariesOnCommandLine │ │ │ │ ├── dummy1.lib │ │ │ │ ├── dummy2.lib │ │ │ │ ├── libdummy1.a │ │ │ │ └── libdummy2.a │ │ ├── TestObject │ │ │ ├── CacheUsingRelativePaths │ │ │ │ ├── File.cpp │ │ │ │ └── Subdir │ │ │ │ │ └── Header.h │ │ │ ├── CustomPreprocessor │ │ │ │ └── a.cpp │ │ │ └── StaleDynamicDeps │ │ │ │ └── CPPGeneratorMain.cpp │ │ ├── TestObjectList │ │ │ ├── CompilerInputFilesRoot │ │ │ │ ├── A │ │ │ │ │ └── file.cpp │ │ │ │ └── B │ │ │ │ │ └── file.cpp │ │ │ ├── ConflictingObjects │ │ │ │ ├── A │ │ │ │ │ └── file.cpp │ │ │ │ └── B │ │ │ │ │ └── file.cpp │ │ │ ├── Exclusions │ │ │ │ ├── ignore.cpp │ │ │ │ └── ok.cpp │ │ │ ├── ExtraOutputPaths │ │ │ │ └── file.cpp │ │ │ └── ObjectListChaining │ │ │ │ ├── file.1.cpp │ │ │ │ └── file.2.cpp │ │ ├── TestPrecompiledHeaders │ │ │ ├── CacheAnalyze_MSVC │ │ │ │ ├── A.cpp │ │ │ │ ├── B.cpp │ │ │ │ ├── PrecompiledHeader.cpp │ │ │ │ └── PrecompiledHeader.h │ │ │ ├── CacheUniqueness │ │ │ │ ├── PCHUser.cpp │ │ │ │ ├── PrecompiledHeader.cpp │ │ │ │ ├── PrecompiledHeaderA.h │ │ │ │ └── PrecompiledHeaderB.h │ │ │ ├── CacheUniqueness2 │ │ │ │ ├── A.cpp │ │ │ │ ├── PrecompiledHeader.cpp │ │ │ │ └── PrecompiledHeader.h │ │ │ ├── Deoptimization │ │ │ │ ├── PrecompiledHeader.cpp │ │ │ │ └── PrecompiledHeader.h │ │ │ ├── PCHOnly │ │ │ │ ├── PrecompiledHeader.cpp │ │ │ │ └── PrecompiledHeader.h │ │ │ ├── PCHReuse │ │ │ │ ├── FileA.cpp │ │ │ │ ├── PrecompiledHeader.cpp │ │ │ │ └── PrecompiledHeader.h │ │ │ ├── PCHUser.cpp │ │ │ ├── PrecompiledHeader.cpp │ │ │ ├── PrecompiledHeader.h │ │ │ └── Slow.h │ │ ├── TestProjectGeneration │ │ │ ├── Solution_ExternalProject │ │ │ │ ├── ExternalDummyProject_2.pyproj │ │ │ │ ├── ExternalDummyProject_3.wixproj │ │ │ │ ├── ExternalMissingProjectGUID.vcxproj │ │ │ │ ├── ExternalProject.csproj │ │ │ │ └── ExternalProjectMissingBraces.csproj │ │ │ └── Solution_Items │ │ │ │ ├── dummy_item.ext │ │ │ │ └── subdir │ │ │ │ ├── dummy_item_1.txt │ │ │ │ └── dummy_item_2.xml │ │ ├── TestResources │ │ │ ├── main.cpp │ │ │ ├── resource.h │ │ │ └── resource.rc │ │ ├── TestTest │ │ │ ├── Fail_Crash │ │ │ │ └── main.cpp │ │ │ ├── Fail_ReturnCode │ │ │ │ └── main.cpp │ │ │ ├── test.cpp │ │ │ └── test_timeout.cpp │ │ ├── TestUnity │ │ │ ├── CacheUsingRelativePaths │ │ │ │ ├── File.cpp │ │ │ │ └── Subdir │ │ │ │ │ └── Header.h │ │ │ ├── ClangStaticAnalysis │ │ │ │ └── file.1.cpp │ │ │ ├── Exclusions │ │ │ │ ├── ignore.cpp │ │ │ │ └── ok.cpp │ │ │ ├── IsolateListFile │ │ │ │ ├── IsolateFileList.txt │ │ │ │ ├── file.1.cpp │ │ │ │ └── file.2.cpp │ │ │ ├── PrecompiledHeader.cpp │ │ │ ├── PrecompiledHeader.h │ │ │ ├── UnityInputIsolatedFiles │ │ │ │ ├── file.1.cpp │ │ │ │ └── file.2.cpp │ │ │ ├── a.cpp │ │ │ ├── b.cpp │ │ │ ├── c.cpp │ │ │ ├── d.cpp │ │ │ ├── e.cpp │ │ │ ├── f.cpp │ │ │ └── wontcompile.cpp │ │ ├── TestWarnings │ │ │ ├── ClangMacroExpansion │ │ │ │ └── clang_macro_expansion.cpp │ │ │ ├── pragma_message.cpp │ │ │ └── warnings.cpp │ │ └── TestZW │ │ │ └── Caching │ │ │ └── file.cpp │ ├── TestMain.cpp │ ├── Tests │ │ ├── FBuildTest.cpp │ │ ├── FBuildTest.h │ │ ├── TestAlias.cpp │ │ ├── TestBFFParsing.cpp │ │ ├── TestBuildAndLinkLibrary.cpp │ │ ├── TestBuildFBuild.cpp │ │ ├── TestCLR.cpp │ │ ├── TestCSharp.cpp │ │ ├── TestCUDA.cpp │ │ ├── TestCache.cpp │ │ ├── TestCachePlugin.cpp │ │ ├── TestCompilationDatabase.cpp │ │ ├── TestCompiler.cpp │ │ ├── TestCompressor.cpp │ │ ├── TestCopy.cpp │ │ ├── TestDLL.cpp │ │ ├── TestDistributed.cpp │ │ ├── TestError.cpp │ │ ├── TestExe.cpp │ │ ├── TestExec.cpp │ │ ├── TestFastCancel.cpp │ │ ├── TestGraph.cpp │ │ ├── TestIf.cpp │ │ ├── TestIncludeParser.cpp │ │ ├── TestLibrary.cpp │ │ ├── TestLinker.cpp │ │ ├── TestNodeReflection.cpp │ │ ├── TestObject.cpp │ │ ├── TestObjectList.cpp │ │ ├── TestPrecompiledHeaders.cpp │ │ ├── TestProjectGeneration.cpp │ │ ├── TestRemoveDir.cpp │ │ ├── TestResources.cpp │ │ ├── TestTest.cpp │ │ ├── TestTextFile.cpp │ │ ├── TestUnity.cpp │ │ ├── TestUserFunctions.cpp │ │ ├── TestVariableStack.cpp │ │ ├── TestWarnings.cpp │ │ └── TestZW.cpp │ └── profile.json │ ├── FBuildWorker │ ├── CMakeLists.txt │ ├── FBuildWorkerOptions.cpp │ ├── FBuildWorkerOptions.h │ ├── Main.cpp │ ├── MainWindowResource.aps │ ├── MainWindowResource.rc │ ├── Worker │ │ ├── IdleDetection.cpp │ │ ├── IdleDetection.h │ │ ├── Worker.cpp │ │ ├── Worker.h │ │ ├── WorkerSettings.cpp │ │ ├── WorkerSettings.h │ │ ├── WorkerWindow.cpp │ │ └── WorkerWindow.h │ └── resource.h │ ├── Icons │ ├── 128x128_blue.png │ ├── 128x128_grey.png │ ├── 16x16_blue.png │ ├── 16x16_grey.png │ ├── 24x24_blue.png │ ├── 24x24_grey.png │ ├── 256x256_blue.png │ ├── 256x256_grey.png │ ├── 32x32_blue.png │ ├── 32x32_grey.png │ ├── 48x48_blue.png │ ├── 64x64_blue.png │ ├── 64x64_grey.png │ ├── blue.ico │ ├── favicon.ico │ └── tray.ico │ └── Integration │ ├── FASTBuild.sublime-syntax.txt │ ├── fbuild.bash-completion │ ├── notepad++markup.xml │ └── usertype.dat ├── External └── LZ4 │ ├── .gitignore │ ├── CMakeLists.txt │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── liblz4-dll.rc.in │ ├── liblz4.pc.in │ ├── lz4.c │ ├── lz4.h │ ├── lz4frame.c │ ├── lz4frame.h │ ├── lz4frame_static.h │ ├── lz4hc.c │ ├── lz4hc.h │ ├── xxhash.c │ └── xxhash.h ├── LICENSE ├── README.md ├── UnrealEngine └── 4.25 │ └── Engine │ └── Source │ ├── Programs │ └── UnrealBuildTool │ │ └── Executors │ │ └── NotForLicensees │ │ └── FASTBuild.cs │ └── Runtime │ └── Engine │ ├── Private │ └── ShaderCompiler │ │ ├── ShaderCompiler.cpp │ │ └── ShaderCompilerFastBuild.cpp │ └── Public │ └── ShaderCompiler.h ├── build.bat └── cmake └── ucm.cmake /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | CMakeFiles 3 | bin 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_property(GLOBAL PROPERTY USE_FOLDERS On) 2 | cmake_minimum_required( VERSION 3.10 ) 3 | 4 | include(cmake/ucm.cmake) 5 | project(FastBuild) 6 | 7 | ucm_set_runtime(STATIC) 8 | 9 | add_compile_definitions(__WINDOWS__ WIN64) 10 | add_compile_definitions($<$:DEBUG>) 11 | add_compile_definitions($<$:RELEASE>) 12 | 13 | 14 | add_subdirectory(External/LZ4) 15 | 16 | add_subdirectory(Code/TestFramework) 17 | add_subdirectory(Code/Core) 18 | add_subdirectory(Code/OSUI) 19 | add_subdirectory(Code/Tools/FBuild/FBuildCore) 20 | add_subdirectory(Code/Tools/FBuild/FBuildApp) 21 | add_subdirectory(Code/Tools/FBuild/FBuildWorker) 22 | 23 | -------------------------------------------------------------------------------- /Code/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME Core) 2 | 3 | ucm_add_dirs(Containers TO SOURCES RECURSIVE) 4 | ucm_add_dirs(CoreTest TO SOURCES RECURSIVE) 5 | ucm_add_dirs(Env TO SOURCES RECURSIVE) 6 | ucm_add_dirs(FileIO TO SOURCES RECURSIVE) 7 | ucm_add_dirs(Math TO SOURCES RECURSIVE) 8 | ucm_add_dirs(Mem TO SOURCES RECURSIVE) 9 | ucm_add_dirs(Network TO SOURCES RECURSIVE) 10 | ucm_add_dirs(Process TO SOURCES RECURSIVE) 11 | ucm_add_dirs(Profile TO SOURCES RECURSIVE) 12 | ucm_add_dirs(Reflection TO SOURCES RECURSIVE) 13 | ucm_add_dirs(Strings TO SOURCES RECURSIVE) 14 | ucm_add_dirs(Time TO SOURCES RECURSIVE) 15 | ucm_add_dirs(Tracing TO SOURCES RECURSIVE) 16 | add_library(Core STATIC ${SOURCES} Core.natvis) 17 | 18 | target_link_libraries(${TARGET_NAME} PUBLIC TestFramework lz4) 19 | 20 | 21 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Libs") 22 | -------------------------------------------------------------------------------- /Code/Core/Containers/Forward.h: -------------------------------------------------------------------------------- 1 | // Forward.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | template < class T, class U > struct ForwardType { using type = T &&; }; 6 | template < class T, class U > struct ForwardType< T &, U & > { using type = T &; }; 7 | template < class T, class U > struct ForwardType< T &, U > { static_assert( ( sizeof( T ), false ), "can not forward rvalue as lvalue" ); }; 8 | 9 | // Macro equivalent to std::forward to avoid function overhead in debug builds 10 | #define Forward( T, x ) static_cast< typename ForwardType< T, decltype( x ) >::type>( x ) 11 | 12 | //------------------------------------------------------------------------------ 13 | -------------------------------------------------------------------------------- /Code/Core/Containers/Move.h: -------------------------------------------------------------------------------- 1 | // Move.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | template struct RemoveReference { using type = T; }; 6 | template struct RemoveReference { using type = T; }; 7 | template struct RemoveReference { using type = T; }; 8 | template using RemoveReferenceT = typename RemoveReference::type; 9 | 10 | //template 11 | //constexpr RemoveReferenceT && 12 | //Move( T && arg ) noexcept 13 | //{ 14 | // return ( static_cast &&>( arg ) ); 15 | //} 16 | 17 | // Macro equivalent to above to avoid function overhead in debug builds 18 | #define Move( x ) static_cast &&>( x ) 19 | 20 | //------------------------------------------------------------------------------ 21 | -------------------------------------------------------------------------------- /Code/Core/CoreTest/TestMain.cpp: -------------------------------------------------------------------------------- 1 | // TestMain.cpp 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "TestFramework/UnitTest.h" 7 | 8 | // main 9 | //------------------------------------------------------------------------------ 10 | int main( int, char *[] ) 11 | { 12 | // Tests to run 13 | REGISTER_TESTGROUP( TestArray ) 14 | REGISTER_TESTGROUP( TestAtomic ) 15 | REGISTER_TESTGROUP( TestAString ) 16 | REGISTER_TESTGROUP( TestEnv ) 17 | REGISTER_TESTGROUP( TestFileIO ) 18 | REGISTER_TESTGROUP( TestFileStream ) 19 | REGISTER_TESTGROUP( TestHash ) 20 | REGISTER_TESTGROUP( TestLevenshteinDistance ) 21 | REGISTER_TESTGROUP( TestMemPoolBlock ) 22 | REGISTER_TESTGROUP( TestMutex ) 23 | REGISTER_TESTGROUP( TestPathUtils ) 24 | REGISTER_TESTGROUP( TestReflection ) 25 | REGISTER_TESTGROUP( TestSemaphore ) 26 | REGISTER_TESTGROUP( TestSharedMemory ) 27 | REGISTER_TESTGROUP( TestSmallBlockAllocator ) 28 | REGISTER_TESTGROUP( TestSystemMutex ) 29 | REGISTER_TESTGROUP( TestTestTCPConnectionPool ) 30 | REGISTER_TESTGROUP( TestTimer ) 31 | 32 | UnitTestManager utm; 33 | 34 | bool allPassed = utm.RunTests(); 35 | 36 | return allPassed ? 0 : -1; 37 | } 38 | 39 | //------------------------------------------------------------------------------ 40 | -------------------------------------------------------------------------------- /Code/Core/Env/ErrorFormat.cpp: -------------------------------------------------------------------------------- 1 | // ErrorFormat - Format errors in a consistent way 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "ErrorFormat.h" 7 | 8 | // CONSTRUCTOR 9 | //------------------------------------------------------------------------------ 10 | ErrorFormat::ErrorFormat() 11 | { 12 | Format( Env::GetLastErr() ); 13 | } 14 | 15 | // CONSTRUCTOR 16 | //------------------------------------------------------------------------------ 17 | ErrorFormat::ErrorFormat( uint32_t error ) 18 | { 19 | Format( error ); 20 | } 21 | 22 | // DESTRUCTOR 23 | //------------------------------------------------------------------------------ 24 | ErrorFormat::~ErrorFormat() = default; 25 | 26 | // Format 27 | //------------------------------------------------------------------------------ 28 | void ErrorFormat::Format( uint32_t error ) 29 | { 30 | if ( error <= 0xFF ) 31 | { 32 | // 255 (0xFF) 33 | m_Buffer.Format( "%u (0x%02x)", error, error ); 34 | } 35 | else if ( error <= 0xFFFF ) 36 | { 37 | // 65535 (0xFFFF) 38 | m_Buffer.Format( "%u (0x%04x)", error, error ); 39 | } 40 | else 41 | { 42 | // 4294967295 (0xFFFFFFFF) 43 | m_Buffer.Format( "%u (0x%08x)", error, error ); 44 | } 45 | } 46 | 47 | //------------------------------------------------------------------------------ 48 | -------------------------------------------------------------------------------- /Code/Core/Env/ErrorFormat.h: -------------------------------------------------------------------------------- 1 | // ErrorFormat - Format errors in a consistent way 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Env.h" 8 | #include "Core/Strings/AStackString.h" 9 | 10 | // Forward Declarations 11 | //------------------------------------------------------------------------------ 12 | 13 | // Defines 14 | //------------------------------------------------------------------------------ 15 | #define LAST_ERROR_STR ErrorFormat( Env::GetLastErr() ).GetString() 16 | #define ERROR_STR( error ) ErrorFormat( (uint32_t)error ).GetString() 17 | 18 | // ErrorFormat 19 | //------------------------------------------------------------------------------ 20 | class ErrorFormat 21 | { 22 | public: 23 | ErrorFormat(); 24 | explicit ErrorFormat( uint32_t error ); 25 | ~ErrorFormat(); 26 | 27 | const char * GetString() const { return m_Buffer.Get(); } 28 | 29 | private: 30 | void Format( uint32_t error ); 31 | 32 | AStackString<32> m_Buffer; 33 | }; 34 | 35 | //------------------------------------------------------------------------------ 36 | -------------------------------------------------------------------------------- /Code/Core/Env/MSVCStaticAnalysis.h: -------------------------------------------------------------------------------- 1 | // MSVCStaticAnalysis 2 | //------------------------------------------------------------------------------ 3 | // 4 | // Wrapper for MSVC SAL annotations to make them a little easier to use 5 | // 6 | //------------------------------------------------------------------------------ 7 | #pragma once 8 | 9 | #if defined( __WINDOWS__ ) && defined( ANALYZE ) 10 | #include 11 | 12 | // printf style function 13 | #define MSVC_SAL_PRINTF _In_z_ _Printf_format_string_ 14 | #else 15 | #define MSVC_SAL_PRINTF 16 | #endif 17 | 18 | //------------------------------------------------------------------------------ 19 | -------------------------------------------------------------------------------- /Code/Core/Env/WindowsHeader.h: -------------------------------------------------------------------------------- 1 | // WindowsHeader 2 | //------------------------------------------------------------------------------ 3 | // 4 | // Windows.h and WinSock2.h mustbe included in a specific order to avoid 5 | // compile errors. This is problematic when headers include other headers 6 | // that include Windows.h, or when using Unity. 7 | // 8 | // To remedy this, we always include Windows.h via this wrapper 9 | // 10 | //------------------------------------------------------------------------------ 11 | #pragma once 12 | 13 | #if !defined( __WINDOWS__ ) 14 | #error Should only be used on __WINDOWS__ 15 | #endif 16 | 17 | // Includes 18 | //------------------------------------------------------------------------------ 19 | #include // WinSock2.h must be first 20 | #include 21 | #include 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /Code/Core/Env/glibc_compat.h: -------------------------------------------------------------------------------- 1 | // glibc_compat 2 | // 3 | // Target older versions of glibc for better Linux distro compatibility 4 | //------------------------------------------------------------------------------ 5 | #pragma once 6 | 7 | // Avoid "Fortify Source" checks 8 | //------------------------------------------------------------------------------ 9 | #undef _FORTIFY_SOURCE 10 | 11 | // Use older memcpy 12 | //------------------------------------------------------------------------------ 13 | __asm__( ".symver memcpy,memcpy@GLIBC_2.2.5" ); 14 | 15 | //------------------------------------------------------------------------------ 16 | -------------------------------------------------------------------------------- /Code/Core/Math/CRC32.h: -------------------------------------------------------------------------------- 1 | // CRC32.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | #include "Core/Strings/AString.h" 9 | 10 | // CRC32 11 | //------------------------------------------------------------------------------ 12 | class CRC32 13 | { 14 | public: 15 | static inline uint32_t Start() { return 0xFFFFFFFF; } 16 | static uint32_t Update( uint32_t crc32, const void * buffer, size_t len ); 17 | static uint32_t UpdateLower( uint32_t crc32, const void * buffer, size_t len ); 18 | static inline uint32_t Stop( uint32_t crc32 ) { return ( crc32 ^ 0xFFFFFFFF ); } 19 | 20 | static uint32_t Calc( const void * buffer, size_t len ); 21 | static uint32_t CalcLower( const void * buffer, size_t len ); 22 | 23 | inline static uint32_t Calc( const AString & string ) { return Calc( string.Get(), string.GetLength() ); } 24 | inline static uint32_t CalcLower( const AString & string ) { return CalcLower( string.Get(), string.GetLength() ); } 25 | }; 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Core/Math/Constants.h: -------------------------------------------------------------------------------- 1 | // Constants.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | //------------------------------------------------------------------------------ 6 | namespace Math 7 | { 8 | const float PI = 3.1415926536f; 9 | const float TWO_PI = 6.2831853072f; 10 | const float PI_ON_TWO = 1.5707963268f; 11 | const float PI_ON_FOUR = 0.7853981634f; 12 | 13 | const float DEGREES_TO_RADIANS = PI/180.0f; 14 | const float RADIANS_TO_DEGREES = 180.0f/PI; 15 | 16 | const float EPSILON = 1.0e-10f; 17 | } 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Core/Math/Conversions.h: -------------------------------------------------------------------------------- 1 | // Conversion.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Math 10 | //------------------------------------------------------------------------------ 11 | namespace Math 12 | { 13 | template 14 | static inline T RoundUp( T value, T alignment ) 15 | { 16 | return ( value + alignment - 1) & ~( alignment - 1 ); 17 | } 18 | template 19 | static inline T Max( T a, T b ) 20 | { 21 | return ( a > b ) ? a : b; 22 | } 23 | template 24 | static inline T Min( T a, T b ) 25 | { 26 | return ( a < b ) ? a : b; 27 | } 28 | template 29 | static inline T Clamp( T a, T b, T c ) 30 | { 31 | return Min( Max( a, b ), c ); 32 | } 33 | template 34 | static inline bool IsPowerOf2( T value ) 35 | { 36 | return ( ( ( value - 1 ) & value ) == 0 ); 37 | } 38 | 39 | }; 40 | 41 | //------------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /Code/Core/Math/Random.cpp: -------------------------------------------------------------------------------- 1 | // Random 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Random.h" 7 | 8 | #include 9 | 10 | // CONSTRUCTOR 11 | //------------------------------------------------------------------------------ 12 | Random::Random() 13 | { 14 | static uint32_t offset( 0 ); 15 | m_Seed = (uint32_t)time( nullptr ) + offset; 16 | offset++; 17 | } 18 | 19 | // GetRand 20 | //------------------------------------------------------------------------------ 21 | uint32_t Random::GetRand() 22 | { 23 | m_Seed = m_Seed * 1103515245 + 12345; 24 | return( (uint32_t)( m_Seed / ( ( CORE_RAND_MAX + 1 ) * 2 ) ) % ( CORE_RAND_MAX + 1 ) ); 25 | } 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Core/Math/Random.h: -------------------------------------------------------------------------------- 1 | // Random 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Random 10 | //------------------------------------------------------------------------------ 11 | class Random 12 | { 13 | public: 14 | static const uint32_t CORE_RAND_MAX = 32767; 15 | 16 | // seed with the current time 17 | Random(); 18 | 19 | // seed with a specific value 20 | explicit inline Random( uint32_t seed ) : m_Seed( seed ) {} 21 | 22 | // random number from 0 to RAND_MAX 23 | uint32_t GetRand(); 24 | 25 | // random float from 0.0f to 1.0f 26 | float GetRandFloat() 27 | { 28 | return ( (float)GetRand() ) / ( (float)CORE_RAND_MAX ); 29 | } 30 | 31 | // random index from 0 to size-1 32 | uint32_t GetRandIndex( uint32_t size ) 33 | { 34 | return ( (uint32_t)( (float)size * ( GetRand() / ( CORE_RAND_MAX + 1.0f ) ) ) ); 35 | } 36 | 37 | // access the seed value 38 | inline void SetSeed( uint32_t seed ) { m_Seed = seed; } 39 | inline uint32_t GetSeed() const { return m_Seed; } 40 | 41 | private: 42 | uint32_t m_Seed; 43 | }; 44 | 45 | //------------------------------------------------------------------------------ 46 | -------------------------------------------------------------------------------- /Code/Core/Math/Trig.h: -------------------------------------------------------------------------------- 1 | // Trig.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include 8 | 9 | // Functions 10 | //------------------------------------------------------------------------------ 11 | inline float Sqrt( float num ) 12 | { 13 | return (float)sqrtf( num ); 14 | } 15 | 16 | inline float Cos( float num ) 17 | { 18 | return (float)cosf( num ); 19 | } 20 | 21 | inline float Sin( float num ) 22 | { 23 | return (float)sinf( num ); 24 | } 25 | 26 | inline float Tan( float num ) 27 | { 28 | return (float)tanf( num ); 29 | } 30 | 31 | inline float Pow( float a, float b ) 32 | { 33 | return powf( a, b ); 34 | } 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/Core/Network/Network.h: -------------------------------------------------------------------------------- 1 | // Network 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Process/Mutex.h" 8 | #include "Core/Process/Thread.h" 9 | #include "Core/Strings/AStackString.h" 10 | 11 | // Forward Declarations 12 | //------------------------------------------------------------------------------ 13 | class AString; 14 | 15 | // Network 16 | //------------------------------------------------------------------------------ 17 | class Network 18 | { 19 | public: 20 | static void GetHostName( AString & hostName); 21 | static void GetIpAddress (AString& ip); 22 | 23 | static uint32_t GetHostIPFromName( const AString & hostName, uint32_t timeoutMS = 1000 ); 24 | 25 | private: 26 | static uint32_t NameResolutionThreadFunc( void * userData ); 27 | 28 | struct NameResolutionData 29 | { 30 | AStackString<> hostName; 31 | bool safeToFree; 32 | }; 33 | }; 34 | 35 | //------------------------------------------------------------------------------ 36 | -------------------------------------------------------------------------------- /Code/Core/Network/NetworkStartupHelper.h: -------------------------------------------------------------------------------- 1 | // NetworkStartupHelper 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #if defined( __WINDOWS__ ) 8 | #include 9 | #endif 10 | 11 | #include "Core/Env/Types.h" 12 | #include "Core/Process/Mutex.h" 13 | 14 | // NetworkStartup 15 | //------------------------------------------------------------------------------ 16 | class NetworkStartupHelper 17 | { 18 | public: 19 | // ensure the network is up around the scope of this object 20 | NetworkStartupHelper(); 21 | ~NetworkStartupHelper() = default; 22 | 23 | // Set master flag to help abort network operations 24 | // NOTE: Flag must remain available once set (i.e. static var) 25 | static void SetMasterShutdownFlag( volatile bool * shutdownFlag ); 26 | static bool IsShuttingDown(); 27 | 28 | private: 29 | static bool s_Started; 30 | static Mutex s_Mutex; 31 | static volatile bool * s_MasterShutdownFlag; 32 | #if defined( __WINDOWS__ ) 33 | static WSADATA s_WSAData; 34 | #endif 35 | }; 36 | 37 | //------------------------------------------------------------------------------ 38 | -------------------------------------------------------------------------------- /Code/Core/Process/Semaphore.h: -------------------------------------------------------------------------------- 1 | // Semaphore.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | #if defined( __APPLE__ ) 10 | #include 11 | #elif defined( __LINUX__ ) 12 | #include 13 | #endif 14 | 15 | // Semaphore 16 | //------------------------------------------------------------------------------ 17 | class Semaphore 18 | { 19 | public: 20 | Semaphore(); 21 | ~Semaphore(); 22 | 23 | void Signal(); // Signal once 24 | void Signal( uint32_t num ); // Signal multiple times 25 | void Wait( uint32_t timeoutMS = 0 ); // Infinite timeout by default 26 | 27 | private: 28 | #if defined( __WINDOWS__ ) 29 | void * m_Semaphore; 30 | #elif defined( __APPLE__ ) 31 | dispatch_semaphore_t m_Semaphore; 32 | #elif defined( __LINUX__ ) 33 | sem_t m_Semaphore; 34 | #endif 35 | }; 36 | 37 | //------------------------------------------------------------------------------ 38 | -------------------------------------------------------------------------------- /Code/Core/Process/SharedMemory.h: -------------------------------------------------------------------------------- 1 | // SharedMemory.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | #if defined( __LINUX__ ) || defined( __APPLE__ ) 9 | #include "Core/Strings/AString.h" 10 | #endif 11 | 12 | // SharedMemory 13 | //------------------------------------------------------------------------------ 14 | class SharedMemory 15 | { 16 | public: 17 | SharedMemory(); 18 | ~SharedMemory(); 19 | 20 | void Create( const char * name, unsigned int size ); 21 | bool Open( const char * name, unsigned int size ); 22 | 23 | void * GetPtr() const { return m_Memory; } 24 | 25 | private: 26 | friend class TestSharedMemory; 27 | void Unmap(); // Used in unit tests 28 | 29 | void * m_Memory; 30 | #if defined( __WINDOWS__ ) 31 | void * m_MapFile; 32 | #elif defined( __LINUX__ ) || defined( __APPLE__ ) 33 | int m_MapFile; 34 | size_t m_Length; 35 | AString m_Name; 36 | #else 37 | #error Unknown Platform 38 | #endif 39 | }; 40 | 41 | //------------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /Code/Core/Process/SystemMutex.h: -------------------------------------------------------------------------------- 1 | // SystemMutex.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Strings/AString.h" 8 | 9 | // SystemMutex 10 | //------------------------------------------------------------------------------ 11 | class SystemMutex 12 | { 13 | public: 14 | explicit SystemMutex( const char * name ); 15 | ~SystemMutex(); 16 | 17 | bool TryLock(); 18 | bool IsLocked() const; 19 | void Unlock(); 20 | 21 | private: 22 | #if defined( __WINDOWS__ ) 23 | void * m_Handle; 24 | #elif defined( __LINUX__ ) || defined( __APPLE__ ) 25 | int m_Handle; 26 | #endif 27 | AString m_Name; 28 | }; 29 | 30 | //------------------------------------------------------------------------------ 31 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/MetaData.h: -------------------------------------------------------------------------------- 1 | // MetaData.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Forward Declarations 6 | //------------------------------------------------------------------------------ 7 | class IMetaData; 8 | 9 | // Includes 10 | //------------------------------------------------------------------------------ 11 | #include "Core/Env/Types.h" 12 | 13 | // Chaining operator for reflection macros 14 | //------------------------------------------------------------------------------ 15 | IMetaData & operator + ( IMetaData & a, IMetaData & b ); 16 | 17 | // No MetaData 18 | //------------------------------------------------------------------------------ 19 | class MetaNone {}; 20 | 21 | // Basic MetaData Types 22 | //------------------------------------------------------------------------------ 23 | IMetaData & MetaFile( bool relative = false ); 24 | IMetaData & MetaHidden(); 25 | IMetaData & MetaOptional(); 26 | IMetaData & MetaPath( bool relative = false ); 27 | IMetaData & MetaRange( int32_t minVal, int32_t maxVal ); 28 | 29 | //------------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/MetaDataInterface.h: -------------------------------------------------------------------------------- 1 | // MetaDaatInterface.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/Object.h" 8 | #include "Core/Reflection/ReflectionMacros.h" 9 | 10 | // IMetaData 11 | //------------------------------------------------------------------------------ 12 | class IMetaData : public Object 13 | { 14 | REFLECT_DECLARE( IMetaData ) 15 | public: 16 | explicit IMetaData(); 17 | virtual ~IMetaData() override; 18 | 19 | const IMetaData * GetNext() const { return m_Next; } 20 | protected: 21 | friend IMetaData & operator + ( IMetaData & a, IMetaData & b ); 22 | 23 | IMetaData * m_Next; 24 | }; 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_File.cpp: -------------------------------------------------------------------------------- 1 | // Meta_File 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_File.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_File, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_File ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_File::Meta_File( bool relative ) 16 | : m_Relative( relative ) 17 | { 18 | } 19 | 20 | // DESTRUCTOR 21 | //------------------------------------------------------------------------------ 22 | Meta_File::~Meta_File() = default; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_File.h: -------------------------------------------------------------------------------- 1 | // Meta_File.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_File 10 | //------------------------------------------------------------------------------ 11 | class Meta_File : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_File ) 14 | public: 15 | explicit Meta_File( bool relative = false ); 16 | virtual ~Meta_File() override; 17 | 18 | inline bool IsRelative() const { return m_Relative; } 19 | 20 | protected: 21 | bool m_Relative; 22 | }; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Hidden.cpp: -------------------------------------------------------------------------------- 1 | // Meta_Hidden 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_Hidden.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_Hidden, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_Hidden ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_Hidden::Meta_Hidden() = default; 16 | 17 | // DESTRUCTOR 18 | //------------------------------------------------------------------------------ 19 | Meta_Hidden::~Meta_Hidden() = default; 20 | 21 | //------------------------------------------------------------------------------ 22 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Hidden.h: -------------------------------------------------------------------------------- 1 | // Meta_Hidden.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_Hidden 10 | //------------------------------------------------------------------------------ 11 | class Meta_Hidden : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_Hidden ) 14 | public: 15 | explicit Meta_Hidden(); 16 | virtual ~Meta_Hidden() override; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Optional.cpp: -------------------------------------------------------------------------------- 1 | // Meta_Optional 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_Optional.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_Optional, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_Optional ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_Optional::Meta_Optional() 16 | { 17 | } 18 | 19 | // DESTRUCTOR 20 | //------------------------------------------------------------------------------ 21 | Meta_Optional::~Meta_Optional() = default; 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Optional.h: -------------------------------------------------------------------------------- 1 | // Meta_Optional.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_Optional 10 | //------------------------------------------------------------------------------ 11 | class Meta_Optional : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_Optional ) 14 | public: 15 | explicit Meta_Optional(); 16 | virtual ~Meta_Optional() override; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Path.cpp: -------------------------------------------------------------------------------- 1 | // Meta_Path 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_Path.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_Path, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_Path ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_Path::Meta_Path( bool relative ) 16 | : m_Relative( relative ) 17 | { 18 | } 19 | 20 | // DESTRUCTOR 21 | //------------------------------------------------------------------------------ 22 | Meta_Path::~Meta_Path() = default; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Path.h: -------------------------------------------------------------------------------- 1 | // Meta_Path.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_Path 10 | //------------------------------------------------------------------------------ 11 | class Meta_Path : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_Path ) 14 | public: 15 | explicit Meta_Path( bool relative = false ); 16 | virtual ~Meta_Path() override; 17 | 18 | inline bool IsRelative() const { return m_Relative; } 19 | 20 | protected: 21 | bool m_Relative; 22 | }; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Range.cpp: -------------------------------------------------------------------------------- 1 | // Meta_Range 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_Range.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_Range, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_Range ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_Range::Meta_Range() 16 | : m_Min( 0 ) 17 | , m_Max( 1 ) 18 | { 19 | } 20 | 21 | // CONSTRUCTOR 22 | //------------------------------------------------------------------------------ 23 | Meta_Range::Meta_Range( int32_t minValue, int32_t maxValue ) 24 | : m_Min( minValue ) 25 | , m_Max( maxValue ) 26 | { 27 | } 28 | 29 | // DESTRUCTOR 30 | //------------------------------------------------------------------------------ 31 | Meta_Range::~Meta_Range() = default; 32 | 33 | //------------------------------------------------------------------------------ 34 | -------------------------------------------------------------------------------- /Code/Core/Reflection/MetaData/Meta_Range.h: -------------------------------------------------------------------------------- 1 | // Meta_Range.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_Range 10 | //------------------------------------------------------------------------------ 11 | class Meta_Range : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_Range ) 14 | public: 15 | explicit Meta_Range(); 16 | explicit Meta_Range( int32_t minValue, int32_t maxValue ); 17 | virtual ~Meta_Range() override; 18 | 19 | inline int32_t GetMin() const { return m_Min; } 20 | inline int32_t GetMax() const { return m_Max; } 21 | 22 | protected: 23 | int32_t m_Min; 24 | int32_t m_Max; 25 | }; 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Core/Reflection/Object.cpp: -------------------------------------------------------------------------------- 1 | // Object.cpp 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Object.h" 7 | #include "Core/Reflection/ReflectionInfo.h" 8 | 9 | // Reflection 10 | //------------------------------------------------------------------------------ 11 | // Object_ReflectionInfo 12 | //------------------------------------------------------------------------------ 13 | class Object_ReflectionInfo : public ReflectionInfo 14 | { 15 | public: 16 | explicit Object_ReflectionInfo() { SetTypeName( "Object" ); m_IsAbstract = true; } 17 | virtual ~Object_ReflectionInfo() = default; 18 | }; 19 | Object_ReflectionInfo g_Object_ReflectionInfo; 20 | 21 | // DynamicCastHelper 22 | //------------------------------------------------------------------------------ 23 | /*static*/ bool Object::CanDynamicCast( const ReflectionInfo * dst, const ReflectionInfo * src ) 24 | { 25 | while ( src ) 26 | { 27 | if ( src == dst ) 28 | { 29 | return true; 30 | } 31 | src = src->GetSuperClass(); 32 | } 33 | return false; 34 | } 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/Core/Reflection/Object.h: -------------------------------------------------------------------------------- 1 | // Object.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | class ReflectionInfo; 12 | 13 | // Object 14 | //------------------------------------------------------------------------------ 15 | class Object 16 | { 17 | public: 18 | inline explicit Object() = default; 19 | inline virtual ~Object() = default; 20 | 21 | virtual const ReflectionInfo * GetReflectionInfoV() const = 0; 22 | 23 | private: 24 | template< class T, class U > 25 | friend T * DynamicCast( U * object ); 26 | static bool CanDynamicCast( const ReflectionInfo * dst, const ReflectionInfo * src ); 27 | }; 28 | void Object_ReflectionInfo_Bind(); 29 | 30 | // DynamicCast 31 | //------------------------------------------------------------------------------ 32 | template < class T, class U > 33 | T * DynamicCast( U * object ) 34 | { 35 | if ( object ) 36 | { 37 | if ( Object::CanDynamicCast( T::GetReflectionInfoS(), object->GetReflectionInfoV() ) ) 38 | { 39 | return (T *)object; 40 | } 41 | } 42 | return nullptr; 43 | } 44 | 45 | //------------------------------------------------------------------------------ 46 | -------------------------------------------------------------------------------- /Code/Core/Reflection/ReflectionIter.h: -------------------------------------------------------------------------------- 1 | // ReflectionIter.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | class ReflectionInfo; 12 | class ReflectedProperty; 13 | 14 | // ReflectionIter 15 | //------------------------------------------------------------------------------ 16 | class ReflectionIter 17 | { 18 | public: 19 | explicit ReflectionIter( const ReflectionInfo * info, uint32_t index ); 20 | 21 | // comparison of iterators 22 | bool operator == ( const ReflectionIter & other ) const; 23 | inline bool operator != ( const ReflectionIter & other ) const { return !( *this == other ); } 24 | 25 | // iterating 26 | void operator ++(); 27 | 28 | // dereferencing 29 | const ReflectedProperty & operator ->() const; 30 | const ReflectedProperty & operator *() const; 31 | 32 | protected: 33 | const ReflectionInfo * m_Info; 34 | uint32_t m_Index; 35 | }; 36 | 37 | //------------------------------------------------------------------------------ 38 | -------------------------------------------------------------------------------- /Code/Core/Reflection/ReflectionSettings.h: -------------------------------------------------------------------------------- 1 | // ReflectionSettings 2 | //------------------------------------------------------------------------------ 3 | 4 | // Do properties and objects retain their names? 5 | //------------------------------------------------------------------------------ 6 | #define REFLECTION_KEEP_STRING_NAMES 7 | 8 | //------------------------------------------------------------------------------ 9 | -------------------------------------------------------------------------------- /Code/Core/Reflection/Struct.cpp: -------------------------------------------------------------------------------- 1 | // Struct 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Struct.h" 7 | 8 | // Core 9 | #include "Core/Reflection/ReflectionInfo.h" 10 | 11 | // Struct_ReflectionInfo 12 | //------------------------------------------------------------------------------ 13 | class Struct_ReflectionInfo : public ReflectionInfo 14 | { 15 | public: 16 | explicit Struct_ReflectionInfo() { SetTypeName( "Struct" ); m_IsAbstract = true; } 17 | virtual ~Struct_ReflectionInfo() = default; 18 | }; 19 | Struct_ReflectionInfo g_Struct_ReflectionInfo; 20 | 21 | //------------------------------------------------------------------------------ 22 | -------------------------------------------------------------------------------- /Code/Core/Reflection/Struct.h: -------------------------------------------------------------------------------- 1 | // Struct.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Struct 6 | //------------------------------------------------------------------------------ 7 | class Struct 8 | { 9 | public: 10 | }; 11 | 12 | //------------------------------------------------------------------------------ 13 | -------------------------------------------------------------------------------- /Code/Core/Strings/LevenshteinDistance.h: -------------------------------------------------------------------------------- 1 | // LevenshteinDistance.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Forward Declare 10 | //------------------------------------------------------------------------------ 11 | class AString; 12 | 13 | // LevenshteinDistance 14 | //------------------------------------------------------------------------------ 15 | class LevenshteinDistance 16 | { 17 | public: 18 | static uint32_t Distance( const char * lhs, const char * rhs ); 19 | static uint32_t Distance( const AString & lhs, const AString & rhs ); 20 | 21 | static uint32_t DistanceI( const char * lhs, const char * rhs ); 22 | static uint32_t DistanceI( const AString & lhs, const AString & rhs ); 23 | }; 24 | 25 | //------------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /Code/Core/Time/Time.h: -------------------------------------------------------------------------------- 1 | // Time.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Time 10 | //------------------------------------------------------------------------------ 11 | class Time 12 | { 13 | public: 14 | static uint64_t GetCurrentFileTime(); 15 | static uint64_t FileTimeToSeconds( uint64_t filetime ); 16 | }; 17 | 18 | //------------------------------------------------------------------------------ 19 | -------------------------------------------------------------------------------- /Code/Core/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: E:/Repos/fbuild/Code/Core 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/FastBuild") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Release") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | -------------------------------------------------------------------------------- /Code/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | Copyright © 2012-2020 Franta Fulin 2 | 3 | This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 6 | 7 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 8 | 9 | 2. If you use this software, in source or binary form, an acknowledgment in the product documentation or credits would be appreciated but is not required. Example: "This product uses FASTBuild © 2012-2020 Franta Fulin." 10 | 11 | 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 12 | 13 | 4. This notice may not be removed or altered from any source distribution. -------------------------------------------------------------------------------- /Code/OSUI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME OSUI) 2 | 3 | set(SOURCES 4 | OSDropDown.cpp 5 | OSDropDown.h 6 | OSFont.cpp 7 | OSFont.h 8 | OSLabel.cpp 9 | OSLabel.h 10 | OSListView.cpp 11 | OSListView.h 12 | OSMenu.cpp 13 | OSMenu.h 14 | OSSplitter.cpp 15 | OSSplitter.h 16 | OSTrayIcon.cpp 17 | OSTrayIcon.h 18 | OSWidget.cpp 19 | OSWidget.h 20 | OSWindow.cpp 21 | OSWindow.h 22 | ) 23 | 24 | add_library(${TARGET_NAME} STATIC ${SOURCES}) 25 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 26 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_HOME_DIRECTORY}/Code) 27 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Libs") -------------------------------------------------------------------------------- /Code/OSUI/OSDropDown.h: -------------------------------------------------------------------------------- 1 | // OSDropDown.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "OSWidget.h" 8 | 9 | // Core 10 | #include "Core/Env/Types.h" 11 | 12 | // Forward Declarations 13 | //------------------------------------------------------------------------------ 14 | class OSFont; 15 | 16 | // OSDropDown 17 | //------------------------------------------------------------------------------ 18 | class OSDropDown : public OSWidget 19 | { 20 | public: 21 | explicit OSDropDown( OSWindow * parentWindow ); 22 | 23 | void SetFont( OSFont * font ); 24 | 25 | void Init( int32_t x, int32_t y, uint32_t w, uint32_t h ); 26 | 27 | void AddItem( const char * itemText ); 28 | void SetSelectedItem( size_t index ); 29 | size_t GetSelectedItem() const; 30 | 31 | void SetEnabled( bool enabled ); 32 | 33 | protected: 34 | OSFont * m_Font; 35 | }; 36 | 37 | //------------------------------------------------------------------------------ 38 | 39 | -------------------------------------------------------------------------------- /Code/OSUI/OSFont.h: -------------------------------------------------------------------------------- 1 | // OSFont.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Env/Types.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | class OSWindow; 12 | 13 | // OSTrayIcon 14 | //------------------------------------------------------------------------------ 15 | class OSFont 16 | { 17 | public: 18 | OSFont(); 19 | ~OSFont(); 20 | 21 | void Init( uint32_t size, const char * fontFamily ); 22 | 23 | #if defined( __WINDOWS__ ) 24 | inline void * GetFont() { return m_Font; } 25 | #endif 26 | 27 | protected: 28 | #if defined( __WINDOWS__ ) 29 | void * m_Font; 30 | #endif 31 | }; 32 | 33 | //------------------------------------------------------------------------------ 34 | 35 | -------------------------------------------------------------------------------- /Code/OSUI/OSLabel.h: -------------------------------------------------------------------------------- 1 | // OSLabel.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "OSWidget.h" 8 | // Core 9 | #include "Core/Env/Types.h" 10 | 11 | // Forward Declarations 12 | //------------------------------------------------------------------------------ 13 | class OSFont; 14 | 15 | // OSTrayIcon 16 | //------------------------------------------------------------------------------ 17 | class OSLabel : public OSWidget 18 | { 19 | public: 20 | explicit OSLabel( OSWindow * parentWindow ); 21 | 22 | void SetFont( OSFont * font ); 23 | 24 | void Init( int32_t x, int32_t y, uint32_t w, uint32_t h, const char * labelText ); 25 | 26 | protected: 27 | OSFont * m_Font; 28 | }; 29 | 30 | //------------------------------------------------------------------------------ 31 | 32 | -------------------------------------------------------------------------------- /Code/OSUI/OSLabel.mm: -------------------------------------------------------------------------------- 1 | // OSLabel.mm 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | // OSUI 7 | #include 8 | #include 9 | 10 | // System 11 | #import 12 | 13 | // LabelOSX_Create 14 | //------------------------------------------------------------------------------ 15 | void * LabelOSX_Create( OSLabel * owner, int32_t x, int32_t y, uint32_t w, uint32_t h, const char * labelText ) 16 | { 17 | NSWindow * window = (__bridge NSWindow *)owner->GetParentWindow()->GetHandle(); 18 | 19 | // Label 20 | CGRect textFrame = CGRectMake(x, y, w, h); 21 | NSTextField * textField = [[NSTextField alloc] initWithFrame:textFrame]; 22 | [textField setStringValue:[NSString stringWithUTF8String:labelText]]; 23 | [textField setBezeled:NO]; 24 | [textField setDrawsBackground:NO]; 25 | [textField setEditable:NO]; 26 | [textField setSelectable:NO]; 27 | [window.contentView addSubview:textField]; 28 | 29 | return (__bridge void *)textField; 30 | } 31 | 32 | //------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /Code/OSUI/OSListView.h: -------------------------------------------------------------------------------- 1 | // OSListView.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "OSWidget.h" 8 | 9 | // Core 10 | #include "Core/Env/Types.h" 11 | 12 | // Forward Declarations 13 | //------------------------------------------------------------------------------ 14 | class OSFont; 15 | 16 | // OSListView 17 | //------------------------------------------------------------------------------ 18 | class OSListView : public OSWidget 19 | { 20 | public: 21 | explicit OSListView( OSWindow * parentWindow ); 22 | 23 | void SetFont( OSFont * font ); 24 | 25 | void Init( int32_t x, int32_t y, uint32_t w, uint32_t h ); 26 | 27 | void AddColumn( const char * columnHeading, uint32_t columnIndex, uint32_t columnWidth ); 28 | void SetItemCount( uint32_t itemCount ); 29 | void AddItem( const char * itemText ); 30 | void SetItemText( uint32_t index, uint32_t subItemIndex, const char * text ); 31 | 32 | protected: 33 | OSFont * m_Font; 34 | }; 35 | 36 | //------------------------------------------------------------------------------ 37 | 38 | -------------------------------------------------------------------------------- /Code/OSUI/OSMenu.h: -------------------------------------------------------------------------------- 1 | // OSMenu.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "OSWidget.h" 8 | 9 | // Core 10 | #include "Core/Env/Types.h" 11 | 12 | // Forward Declarations 13 | //------------------------------------------------------------------------------ 14 | 15 | // OSMenu 16 | //------------------------------------------------------------------------------ 17 | class OSMenu : public OSWidget 18 | { 19 | public: 20 | explicit OSMenu( OSWindow * parentWindow ); 21 | ~OSMenu(); 22 | 23 | void Init(); 24 | 25 | void AddItem( const char * text ); 26 | 27 | bool ShowAndWaitForSelection( uint32_t & outIndex ); 28 | 29 | protected: 30 | #if defined( __WINDOWS__ ) 31 | void * m_Menu; 32 | #endif 33 | }; 34 | 35 | //------------------------------------------------------------------------------ 36 | 37 | -------------------------------------------------------------------------------- /Code/OSUI/OSSplitter.h: -------------------------------------------------------------------------------- 1 | // OSSplitter.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "OSWidget.h" 8 | 9 | // Core 10 | #include "Core/Env/Types.h" 11 | 12 | // Forward Declarations 13 | //------------------------------------------------------------------------------ 14 | 15 | // OSSplitter 16 | //------------------------------------------------------------------------------ 17 | class OSSplitter : public OSWidget 18 | { 19 | public: 20 | explicit OSSplitter( OSWindow * parentWindow ); 21 | 22 | void Init( int32_t x, int32_t y, uint32_t w, uint32_t h ); 23 | }; 24 | 25 | //------------------------------------------------------------------------------ 26 | 27 | -------------------------------------------------------------------------------- /Code/OSUI/OSSplitter.mm: -------------------------------------------------------------------------------- 1 | // OSSplitter.mm 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | // OSUI 7 | #include 8 | #include 9 | 10 | // System 11 | #import 12 | 13 | // SplitterOSX_Create 14 | //------------------------------------------------------------------------------ 15 | void * SplitterOSX_Create( OSSplitter * owner, int32_t x, int32_t y, uint32_t w, uint32_t h ) 16 | { 17 | NSWindow * window = (__bridge NSWindow *)owner->GetParentWindow()->GetHandle(); 18 | 19 | // Label 20 | CGRect boxFrame = CGRectMake(x, y, w, h); 21 | NSBox * box = [[NSBox alloc] initWithFrame:boxFrame]; 22 | [window.contentView addSubview:box]; 23 | 24 | return (__bridge void *)box; 25 | } 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/OSUI/OSTrayIcon.h: -------------------------------------------------------------------------------- 1 | // OSTrayIcon.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #if defined( __WINDOWS__ ) 8 | #include "Core/Env/WindowsHeader.h" // TODO: Remove need for this 9 | #include // TODO: Remove need for this 10 | #endif 11 | 12 | // Forward Declarations 13 | //------------------------------------------------------------------------------ 14 | class AString; 15 | class OSMenu; 16 | class OSWindow; 17 | 18 | // OSTrayIcon 19 | //------------------------------------------------------------------------------ 20 | class OSTrayIcon 21 | { 22 | public: 23 | explicit OSTrayIcon( OSWindow * parentWindow, const AString & toolTip ); 24 | ~OSTrayIcon(); 25 | 26 | void ShowNotification( const char * msg ); 27 | 28 | void SetMenu( OSMenu * menu ); 29 | 30 | #if defined( __OSX__ ) 31 | void * GetHandle() const { return m_Handle; } 32 | #endif 33 | protected: 34 | #if defined( __WINDOWS__ ) 35 | NOTIFYICONDATA m_NotifyIconData; // TODO: Remote use of Shellapi.h from header 36 | #endif 37 | #if defined( __OSX__ ) 38 | void * m_Handle = nullptr; 39 | #endif 40 | }; 41 | 42 | //------------------------------------------------------------------------------ 43 | 44 | -------------------------------------------------------------------------------- /Code/OSUI/OSTrayIcon.mm: -------------------------------------------------------------------------------- 1 | // OSTrayIcon.mm 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | // OSUI 7 | #include 8 | #include 9 | 10 | // System 11 | #import 12 | 13 | // TrayIconOSX_Create 14 | //------------------------------------------------------------------------------ 15 | void * TrayIconOSX_Create( void * iconData, size_t iconDataSize ) 16 | { 17 | // Create NSImage from data 18 | NSImage * statusImage = [[NSImage alloc] initWithData:[NSData dataWithBytes:iconData length:iconDataSize]]; 19 | 20 | // Add status item to global status bar 21 | NSStatusItem * statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]; 22 | [statusItem.button setImage:statusImage]; 23 | 24 | return (__bridge void *)statusItem; 25 | } 26 | 27 | // TrayIconOSX_SetMenu 28 | //------------------------------------------------------------------------------ 29 | void TrayIconOSX_SetMenu( OSTrayIcon * owner, OSMenu * menu ) 30 | { 31 | NSStatusItem * statusItem = (__bridge NSStatusItem *)owner->GetHandle(); 32 | NSMenu * nsMenu = (__bridge NSMenu *)menu->GetHandle(); 33 | [statusItem setMenu:nsMenu]; 34 | } 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/OSUI/OSWidget.h: -------------------------------------------------------------------------------- 1 | // OSWidget.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | 8 | // Forward Declarations 9 | //------------------------------------------------------------------------------ 10 | class OSWindow; 11 | 12 | // OSWidget 13 | //------------------------------------------------------------------------------ 14 | class OSWidget 15 | { 16 | public: 17 | explicit OSWidget( OSWindow * parentWindow ); 18 | virtual ~OSWidget(); 19 | 20 | void Init(); 21 | inline bool IsInitialized() const { return m_Initialized; } 22 | 23 | inline OSWindow * GetParentWindow() const { return m_Parent; } 24 | inline void * GetHandle() const { return m_Handle; } 25 | 26 | protected: 27 | OSWindow * m_Parent; 28 | void * m_Handle; 29 | bool m_Initialized; 30 | 31 | #if defined( __WINDOWS__ ) 32 | void InitCommonControls(); // Called by Widgets that need commctl 33 | static bool s_CommonControlsInitialized; 34 | #endif 35 | }; 36 | 37 | //------------------------------------------------------------------------------ 38 | -------------------------------------------------------------------------------- /Code/TestFramework/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME TestFramework) 2 | add_library(TestFramework STATIC 3 | UnitTest.cpp 4 | UnitTestManager.cpp 5 | UnitTest.h 6 | UnitTestManager.h 7 | ) 8 | 9 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_HOME_DIRECTORY}/Code) 11 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Test") -------------------------------------------------------------------------------- /Code/TestFramework/UnitTest.cpp: -------------------------------------------------------------------------------- 1 | // UnitTest.cpp - interface for a unit test 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "UnitTest.h" 7 | 8 | // TestNoReturn 9 | //------------------------------------------------------------------------------ 10 | #if defined( __WINDOWS__ ) 11 | void TestNoReturn() 12 | { 13 | #if defined( __clang__ ) 14 | for (;;) {} 15 | #endif 16 | } 17 | #endif 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/BFFFuzzer/bff.dict: -------------------------------------------------------------------------------- 1 | # Function names 2 | "Alias" 3 | "Compiler" 4 | "Copy" 5 | "CopyDir" 6 | "CSAssembly" 7 | "DLL" 8 | "Exec" 9 | "Executable" 10 | "ForEach" 11 | "Library" 12 | "ObjectList" 13 | "Print" 14 | "RemoveDir" 15 | "Settings" 16 | "Test" 17 | "Unity" 18 | "Using" 19 | "VCXProject" 20 | "VSSolution" 21 | "XCodeProject" 22 | 23 | # Preprocessor-like keywords 24 | "#define" 25 | "#undef" 26 | "#if" 27 | "#else" 28 | "#endif" 29 | "#include" 30 | "#import" 31 | "#once" 32 | 33 | # Predefined constants 34 | "__WINDOWS__" 35 | "__LINUX__" 36 | "__OSX__" 37 | 38 | # Other interesting sequences 39 | "exists" 40 | "not" 41 | "in" 42 | "==" 43 | "!=" 44 | "true" 45 | "false" 46 | "//" 47 | "+" 48 | "-" 49 | "=" 50 | "[]" 51 | "{}" 52 | "''" 53 | "\"\"" 54 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/docs/img/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/docs/img/bullet.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/docs/img/home_timings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/docs/img/home_timings.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/docs/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/docs/img/logo.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/docs/img/worker_available.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/docs/img/worker_available.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/docs/img/worker_available_always.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/docs/img/worker_available_always.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/docs/img/worker_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/docs/img/worker_connection.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Documentation/favicon.ico -------------------------------------------------------------------------------- /Code/Tools/FBuild/Documentation/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildApp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME FBuild) 2 | 3 | 4 | add_executable(${TARGET_NAME} Main.cpp) 5 | target_link_libraries(${TARGET_NAME} PRIVATE Core FBuildCore Advapi32.lib kernel32.lib Ws2_32.lib User32.lib) 6 | 7 | 8 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Apps") 9 | 10 | install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_HOME_DIRECTORY}/bin) -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/BFFFileExists.h: -------------------------------------------------------------------------------- 1 | // BFFFileExists 2 | // 3 | // Track #if file_exists checks 4 | //------------------------------------------------------------------------------ 5 | #pragma once 6 | 7 | // Includes 8 | //------------------------------------------------------------------------------ 9 | #include "Core/Containers/Array.h" 10 | #include "Core/Strings/AString.h" 11 | 12 | // Forward Declarations 13 | //------------------------------------------------------------------------------ 14 | class AString; 15 | class IOStream; 16 | 17 | // BFFFileExists 18 | //------------------------------------------------------------------------------ 19 | class BFFFileExists 20 | { 21 | public: 22 | explicit BFFFileExists(); 23 | ~BFFFileExists(); 24 | 25 | // When parsing, file existing is checked/tracked and saved to the DB 26 | bool CheckFile( const AString & fileName ); 27 | void Save( IOStream & stream ) const; 28 | 29 | // When loading an existing DB, we check if anything changed 30 | bool Load( IOStream & stream ); 31 | const AString * CheckForChanges( bool & outAdded ) const; 32 | 33 | private: 34 | Array< AString > m_FileNames; 35 | Array< bool > m_FileExists; 36 | }; 37 | 38 | //------------------------------------------------------------------------------ 39 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/BFFKeywords.h: -------------------------------------------------------------------------------- 1 | // BFFKeywords 2 | //------------------------------------------------------------------------------ 3 | 4 | // Defines 5 | //------------------------------------------------------------------------------ 6 | #define BFF_KEYWORD_DEFINE "define" 7 | #define BFF_KEYWORD_ELSE "else" 8 | #define BFF_KEYWORD_ENDIF "endif" 9 | #define BFF_KEYWORD_EXISTS "exists" 10 | #define BFF_KEYWORD_FALSE "false" 11 | #define BFF_KEYWORD_FILE_EXISTS "file_exists" 12 | #define BFF_KEYWORD_FUNCTION "function" 13 | #define BFF_KEYWORD_IF "if" 14 | #define BFF_KEYWORD_IMPORT "import" 15 | #define BFF_KEYWORD_IN "in" 16 | #define BFF_KEYWORD_INCLUDE "include" 17 | #define BFF_KEYWORD_NOT "not" 18 | #define BFF_KEYWORD_ONCE "once" 19 | #define BFF_KEYWORD_TRUE "true" 20 | #define BFF_KEYWORD_UNDEF "undef" 21 | 22 | //------------------------------------------------------------------------------ 23 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/BFFMacros.h: -------------------------------------------------------------------------------- 1 | // BFFMacros - manages defined macros 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Containers/Array.h" 8 | #include "Core/Containers/Singleton.h" 9 | 10 | // Forward Declarations 11 | //------------------------------------------------------------------------------ 12 | class AString; 13 | 14 | // BFFMacros 15 | //------------------------------------------------------------------------------ 16 | class BFFMacros : public Singleton< BFFMacros > 17 | { 18 | public: 19 | explicit BFFMacros(); 20 | ~BFFMacros(); 21 | 22 | const Array< AString > & Tokens() const { return m_Tokens; } 23 | 24 | bool IsDefined( const AString & token ) const; 25 | 26 | bool Define( const AString & token ); 27 | bool Undefine( const AString & token ); 28 | 29 | private: 30 | Array< AString > m_Tokens; 31 | }; 32 | 33 | //------------------------------------------------------------------------------ 34 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionAlias.cpp: -------------------------------------------------------------------------------- 1 | // FunctionAlias 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionAlias.h" 7 | #include "Tools/FBuild/FBuildCore/FBuild.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/AliasNode.h" 10 | 11 | // CONSTRUCTOR 12 | //------------------------------------------------------------------------------ 13 | FunctionAlias::FunctionAlias() 14 | : Function( "Alias" ) 15 | { 16 | } 17 | 18 | // AcceptsHeader 19 | //------------------------------------------------------------------------------ 20 | /*virtual*/ bool FunctionAlias::AcceptsHeader() const 21 | { 22 | return true; 23 | } 24 | 25 | // NeedsHeader 26 | //------------------------------------------------------------------------------ 27 | /*virtual*/ bool FunctionAlias::NeedsHeader() const 28 | { 29 | return true; 30 | } 31 | 32 | // CreateNode 33 | //------------------------------------------------------------------------------ 34 | /*virtual*/ Node * FunctionAlias::CreateNode() const 35 | { 36 | return FNEW( AliasNode ); 37 | } 38 | 39 | //------------------------------------------------------------------------------ 40 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionAlias.h: -------------------------------------------------------------------------------- 1 | // FunctionAlias 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionAlias 10 | //------------------------------------------------------------------------------ 11 | class FunctionAlias : public Function 12 | { 13 | public: 14 | explicit FunctionAlias(); 15 | inline virtual ~FunctionAlias() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual bool NeedsHeader() const override; 20 | virtual Node * CreateNode() const override; 21 | }; 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionCSAssembly.cpp: -------------------------------------------------------------------------------- 1 | // FunctionCSAssembly 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionCSAssembly.h" 7 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/CSNode.h" 9 | 10 | // CONSTRUCTOR 11 | //------------------------------------------------------------------------------ 12 | FunctionCSAssembly::FunctionCSAssembly() 13 | : Function( "CSAssembly" ) 14 | { 15 | } 16 | 17 | // AcceptsHeader 18 | //------------------------------------------------------------------------------ 19 | /*virtual*/ bool FunctionCSAssembly::AcceptsHeader() const 20 | { 21 | return true; 22 | } 23 | 24 | // CreateNode 25 | //------------------------------------------------------------------------------ 26 | /*virtual*/ Node * FunctionCSAssembly::CreateNode() const 27 | { 28 | return FNEW( CSNode ); 29 | } 30 | 31 | //------------------------------------------------------------------------------ 32 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionCSAssembly.h: -------------------------------------------------------------------------------- 1 | // FunctionCSAssembly 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionCSAssembly 10 | //------------------------------------------------------------------------------ 11 | class FunctionCSAssembly : public Function 12 | { 13 | public: 14 | explicit FunctionCSAssembly(); 15 | inline virtual ~FunctionCSAssembly() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual Node * CreateNode() const override; 20 | }; 21 | 22 | //------------------------------------------------------------------------------ 23 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionCompiler.h: -------------------------------------------------------------------------------- 1 | // FunctionCompiler 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionCompiler 10 | //------------------------------------------------------------------------------ 11 | class FunctionCompiler : public Function 12 | { 13 | public: 14 | explicit FunctionCompiler(); 15 | inline virtual ~FunctionCompiler() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual bool NeedsHeader() const override; 20 | virtual Node * CreateNode() const override; 21 | }; 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionCopy.h: -------------------------------------------------------------------------------- 1 | // FunctionCopy 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // Core 10 | #include "Core/Containers/Array.h" 11 | 12 | // FunctionCopy 13 | //------------------------------------------------------------------------------ 14 | class FunctionCopy : public Function 15 | { 16 | public: 17 | explicit FunctionCopy(); 18 | inline virtual ~FunctionCopy() override = default; 19 | 20 | protected: 21 | virtual bool AcceptsHeader() const override; 22 | virtual bool Commit( NodeGraph & nodeGraph, const BFFToken * funcStartIter ) const override; 23 | 24 | bool GetSourceNodes( const BFFToken * iter, Node * node, Array< Node * > & nodes ) const; 25 | }; 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionCopyDir.cpp: -------------------------------------------------------------------------------- 1 | // FunctionAlias 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionCopyDir.h" 7 | #include "Tools/FBuild/FBuildCore/FBuild.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/CopyDirNode.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 10 | 11 | // Core 12 | #include "Core/FileIO/PathUtils.h" 13 | 14 | // CONSTRUCTOR 15 | //------------------------------------------------------------------------------ 16 | FunctionCopyDir::FunctionCopyDir() 17 | : Function( "CopyDir" ) 18 | { 19 | } 20 | 21 | // AcceptsHeader 22 | //------------------------------------------------------------------------------ 23 | /*virtual*/ bool FunctionCopyDir::AcceptsHeader() const 24 | { 25 | return true; 26 | } 27 | 28 | // NeedsHeader 29 | //------------------------------------------------------------------------------ 30 | /*virtual*/ bool FunctionCopyDir::NeedsHeader() const 31 | { 32 | return true; 33 | } 34 | 35 | // CreateNode 36 | //------------------------------------------------------------------------------ 37 | /*virtual*/ Node * FunctionCopyDir::CreateNode() const 38 | { 39 | return FNEW( CopyDirNode ); 40 | } 41 | 42 | //------------------------------------------------------------------------------ 43 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionCopyDir.h: -------------------------------------------------------------------------------- 1 | // FunctionCopyDir 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionCopyDir 10 | //------------------------------------------------------------------------------ 11 | class FunctionCopyDir : public Function 12 | { 13 | public: 14 | explicit FunctionCopyDir(); 15 | inline virtual ~FunctionCopyDir() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual bool NeedsHeader() const override; 20 | virtual Node * CreateNode() const override; 21 | }; 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionDLL.cpp: -------------------------------------------------------------------------------- 1 | // FunctionDLL 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionDLL.h" 7 | 8 | // FBuildCore 9 | #include "Tools/FBuild/FBuildCore/Graph/DLLNode.h" 10 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 11 | 12 | // CONSTRUCTOR 13 | //------------------------------------------------------------------------------ 14 | FunctionDLL::FunctionDLL() 15 | : FunctionExecutable() 16 | { 17 | // override name set by FunctionExecutable base class 18 | m_Name = "DLL"; 19 | } 20 | 21 | // CreateNode 22 | //------------------------------------------------------------------------------ 23 | /*virtual*/ Node * FunctionDLL::CreateNode() const 24 | { 25 | return FNEW( DLLNode ); 26 | } 27 | 28 | //------------------------------------------------------------------------------ 29 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionDLL.h: -------------------------------------------------------------------------------- 1 | // FunctionDLL 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "FunctionExecutable.h" 8 | 9 | // FunctionDLL 10 | //------------------------------------------------------------------------------ 11 | class FunctionDLL : public FunctionExecutable 12 | { 13 | public: 14 | explicit FunctionDLL(); 15 | inline virtual ~FunctionDLL() override = default; 16 | virtual Node * CreateNode() const override; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionError.h: -------------------------------------------------------------------------------- 1 | // FunctionError 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionError 10 | //------------------------------------------------------------------------------ 11 | class FunctionError : public Function 12 | { 13 | public: 14 | explicit FunctionError(); 15 | inline virtual ~FunctionError() override = default; 16 | 17 | virtual bool AcceptsHeader() const override; 18 | virtual bool NeedsHeader() const override; 19 | virtual bool NeedsBody() const override; 20 | virtual bool ParseFunction( NodeGraph & nodeGraph, 21 | BFFParser & parser, 22 | const BFFToken * functionNameStart, 23 | const BFFTokenRange & headerRange, 24 | const BFFTokenRange & bodyRange ) const override; 25 | }; 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionExec.cpp: -------------------------------------------------------------------------------- 1 | // FunctionTest 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionExec.h" 7 | #include "Tools/FBuild/FBuildCore/FBuild.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/ExecNode.h" 10 | 11 | // CONSTRUCTOR 12 | //------------------------------------------------------------------------------ 13 | FunctionExec::FunctionExec() 14 | : Function( "Exec" ) 15 | { 16 | } 17 | 18 | // AcceptsHeader 19 | //------------------------------------------------------------------------------ 20 | /*virtual*/ bool FunctionExec::AcceptsHeader() const 21 | { 22 | return true; 23 | } 24 | 25 | // CreateNode 26 | //------------------------------------------------------------------------------ 27 | /*virtual*/ Node * FunctionExec::CreateNode() const 28 | { 29 | return FNEW( ExecNode ); 30 | } 31 | 32 | //------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionExec.h: -------------------------------------------------------------------------------- 1 | // FunctionExec 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionExec 10 | //------------------------------------------------------------------------------ 11 | class FunctionExec : public Function 12 | { 13 | public: 14 | explicit FunctionExec(); 15 | inline virtual ~FunctionExec() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual Node * CreateNode() const override; 20 | }; 21 | 22 | //------------------------------------------------------------------------------ 23 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionExecutable.cpp: -------------------------------------------------------------------------------- 1 | // FunctionExecutable 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionExecutable.h" 7 | #include "Tools/FBuild/FBuildCore/Graph/ExeNode.h" 8 | 9 | // CONSTRUCTOR 10 | //------------------------------------------------------------------------------ 11 | FunctionExecutable::FunctionExecutable() 12 | : Function( "Executable" ) 13 | { 14 | } 15 | 16 | // AcceptsHeader 17 | //------------------------------------------------------------------------------ 18 | /*virtual*/ bool FunctionExecutable::AcceptsHeader() const 19 | { 20 | return true; 21 | } 22 | 23 | // CreateNode 24 | //------------------------------------------------------------------------------ 25 | /*virtual*/ Node * FunctionExecutable::CreateNode() const 26 | { 27 | return FNEW( ExeNode ); 28 | } 29 | 30 | //------------------------------------------------------------------------------ 31 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionExecutable.h: -------------------------------------------------------------------------------- 1 | // FunctionExecutable 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | #include "Core/Containers/Array.h" 10 | 11 | // Fwd Declarations 12 | //------------------------------------------------------------------------------ 13 | class AString; 14 | class Dependencies; 15 | class Node; 16 | 17 | // FunctionExecutable 18 | //------------------------------------------------------------------------------ 19 | class FunctionExecutable : public Function 20 | { 21 | public: 22 | explicit FunctionExecutable(); 23 | inline virtual ~FunctionExecutable() override = default; 24 | 25 | protected: 26 | virtual bool AcceptsHeader() const override; 27 | virtual Node * CreateNode() const override; 28 | }; 29 | 30 | //------------------------------------------------------------------------------ 31 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionForEach.h: -------------------------------------------------------------------------------- 1 | // FunctionForEach 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionForEach 10 | //------------------------------------------------------------------------------ 11 | class FunctionForEach : public Function 12 | { 13 | public: 14 | explicit FunctionForEach(); 15 | inline virtual ~FunctionForEach() override = default; 16 | 17 | virtual bool AcceptsHeader() const override; 18 | virtual bool NeedsHeader() const override; 19 | virtual bool ParseFunction( NodeGraph & nodeGraph, 20 | BFFParser & parser, 21 | const BFFToken * functionNameStart, 22 | const BFFTokenRange & headerRange, 23 | const BFFTokenRange & bodyRange ) const override; 24 | }; 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionLibrary.cpp: -------------------------------------------------------------------------------- 1 | // FunctionLibrary 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionLibrary.h" 7 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/LibraryNode.h" 9 | 10 | // CONSTRUCTOR 11 | //------------------------------------------------------------------------------ 12 | FunctionLibrary::FunctionLibrary() 13 | : FunctionObjectList() 14 | { 15 | m_Name = "Library"; 16 | } 17 | 18 | // AcceptsHeader 19 | //------------------------------------------------------------------------------ 20 | /*virtual*/ bool FunctionLibrary::AcceptsHeader() const 21 | { 22 | return true; 23 | } 24 | 25 | // NeedsHeader 26 | //------------------------------------------------------------------------------ 27 | /*virtual*/ bool FunctionLibrary::NeedsHeader() const 28 | { 29 | return false; 30 | } 31 | 32 | // CreateNode 33 | //------------------------------------------------------------------------------ 34 | /*virtual*/ Node * FunctionLibrary::CreateNode() const 35 | { 36 | return FNEW( LibraryNode ); 37 | } 38 | 39 | //------------------------------------------------------------------------------ 40 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionLibrary.h: -------------------------------------------------------------------------------- 1 | // FunctionLibrary 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | #include "FunctionObjectList.h" 9 | 10 | // FunctionLibrary 11 | //------------------------------------------------------------------------------ 12 | class FunctionLibrary : public FunctionObjectList 13 | { 14 | public: 15 | explicit FunctionLibrary(); 16 | inline virtual ~FunctionLibrary() override = default; 17 | 18 | protected: 19 | virtual bool AcceptsHeader() const override; 20 | virtual bool NeedsHeader() const override; 21 | virtual Node * CreateNode() const override; 22 | }; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionPrint.h: -------------------------------------------------------------------------------- 1 | // FunctionPrint 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionAlias 10 | //------------------------------------------------------------------------------ 11 | class FunctionPrint : public Function 12 | { 13 | public: 14 | explicit FunctionPrint(); 15 | inline virtual ~FunctionPrint() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual bool NeedsHeader() const override; 20 | virtual bool NeedsBody() const override; 21 | 22 | virtual bool ParseFunction( NodeGraph & nodeGraph, 23 | BFFParser & parser, 24 | const BFFToken * functionNameStart, 25 | const BFFTokenRange & headerRange, 26 | const BFFTokenRange & bodyRange ) const override; 27 | 28 | static void PrintVarRecurse( const BFFVariable & var, uint32_t indent ); 29 | }; 30 | 31 | //------------------------------------------------------------------------------ 32 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionRemoveDir.h: -------------------------------------------------------------------------------- 1 | // FunctionRemoveDir 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionRemoveDir 10 | //------------------------------------------------------------------------------ 11 | class FunctionRemoveDir : public Function 12 | { 13 | public: 14 | explicit FunctionRemoveDir(); 15 | inline virtual ~FunctionRemoveDir() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual bool NeedsHeader() const override; 20 | virtual bool Commit( NodeGraph & nodeGraph, const BFFToken * funcStartIter ) const override; 21 | virtual Node * CreateNode() const override; 22 | }; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionSettings.h: -------------------------------------------------------------------------------- 1 | // FunctionSettings - Manage global settings 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionSettings 10 | //------------------------------------------------------------------------------ 11 | class FunctionSettings : public Function 12 | { 13 | public: 14 | explicit FunctionSettings(); 15 | inline virtual ~FunctionSettings() override = default; 16 | 17 | protected: 18 | virtual bool IsUnique() const override; 19 | virtual bool Commit( NodeGraph & nodeGraph, const BFFToken * funcStartIter ) const override; 20 | virtual Node * CreateNode() const override; 21 | }; 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionTest.cpp: -------------------------------------------------------------------------------- 1 | // FunctionTest 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionTest.h" 7 | #include "Tools/FBuild/FBuildCore/FBuild.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/TestNode.h" 10 | 11 | // CONSTRUCTOR 12 | //------------------------------------------------------------------------------ 13 | FunctionTest::FunctionTest() 14 | : Function( "Test" ) 15 | { 16 | } 17 | 18 | // AcceptsHeader 19 | //------------------------------------------------------------------------------ 20 | /*virtual*/ bool FunctionTest::AcceptsHeader() const 21 | { 22 | return true; 23 | } 24 | 25 | // CreateNode 26 | //------------------------------------------------------------------------------ 27 | /*virtual*/ Node * FunctionTest::CreateNode() const 28 | { 29 | return FNEW( TestNode ); 30 | } 31 | 32 | //------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionTest.h: -------------------------------------------------------------------------------- 1 | // FunctionTest 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionTest 10 | //------------------------------------------------------------------------------ 11 | class FunctionTest : public Function 12 | { 13 | public: 14 | explicit FunctionTest(); 15 | inline virtual ~FunctionTest() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual Node * CreateNode() const override; 20 | }; 21 | 22 | //------------------------------------------------------------------------------ 23 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionTextFile.cpp: -------------------------------------------------------------------------------- 1 | // FunctionTextFile 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionTextFile.h" 7 | #include "Tools/FBuild/FBuildCore/Graph/TextFileNode.h" 8 | 9 | // CONSTRUCTOR 10 | //------------------------------------------------------------------------------ 11 | FunctionTextFile::FunctionTextFile() 12 | : Function( "TextFile" ) 13 | { 14 | } 15 | 16 | // DESTRUCTOR 17 | //------------------------------------------------------------------------------ 18 | /*virtual*/ FunctionTextFile::~FunctionTextFile() = default; 19 | 20 | // AcceptsHeader 21 | //------------------------------------------------------------------------------ 22 | /*virtual*/ bool FunctionTextFile::AcceptsHeader() const 23 | { 24 | return true; 25 | } 26 | 27 | // CreateNode 28 | //------------------------------------------------------------------------------ 29 | /*virtual*/ Node * FunctionTextFile::CreateNode() const 30 | { 31 | return FNEW( TextFileNode ); 32 | } 33 | 34 | //------------------------------------------------------------------------------ 35 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionTextFile.h: -------------------------------------------------------------------------------- 1 | // FunctionTextFile 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionTextFile 10 | //------------------------------------------------------------------------------ 11 | class FunctionTextFile : public Function 12 | { 13 | public: 14 | explicit FunctionTextFile(); 15 | virtual ~FunctionTextFile() override; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual Node * CreateNode() const override; 20 | }; 21 | 22 | //------------------------------------------------------------------------------ 23 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionUnity.cpp: -------------------------------------------------------------------------------- 1 | // FunctionUnity 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionUnity.h" 7 | #include "Tools/FBuild/FBuildCore/Graph/UnityNode.h" 8 | 9 | // UnityNode 10 | //------------------------------------------------------------------------------ 11 | class UnityNode; 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | FunctionUnity::FunctionUnity() 16 | : Function( "Unity" ) 17 | { 18 | } 19 | 20 | // AcceptsHeader 21 | //------------------------------------------------------------------------------ 22 | /*virtual*/ bool FunctionUnity::AcceptsHeader() const 23 | { 24 | return true; 25 | } 26 | 27 | // NeedsHeader 28 | //------------------------------------------------------------------------------ 29 | /*virtual*/ bool FunctionUnity::NeedsHeader() const 30 | { 31 | return true; 32 | } 33 | 34 | // CreateNode 35 | //------------------------------------------------------------------------------ 36 | /*virtual*/ Node * FunctionUnity::CreateNode() const 37 | { 38 | return FNEW( UnityNode ); 39 | } 40 | 41 | //------------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionUnity.h: -------------------------------------------------------------------------------- 1 | // FunctionUnity 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | class FunctionUnity : public Function 10 | { 11 | public: 12 | explicit FunctionUnity(); 13 | inline virtual ~FunctionUnity() override = default; 14 | 15 | protected: 16 | virtual bool AcceptsHeader() const override; 17 | virtual bool NeedsHeader() const override; 18 | virtual Node * CreateNode() const override; 19 | }; 20 | 21 | //------------------------------------------------------------------------------ 22 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionUsing.h: -------------------------------------------------------------------------------- 1 | // FunctionUsing 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // FunctionAlias 10 | //------------------------------------------------------------------------------ 11 | class FunctionUsing : public Function 12 | { 13 | public: 14 | explicit FunctionUsing(); 15 | inline virtual ~FunctionUsing() override = default; 16 | 17 | protected: 18 | virtual bool AcceptsHeader() const override; 19 | virtual bool NeedsHeader() const override; 20 | virtual bool NeedsBody() const override; 21 | 22 | virtual bool ParseFunction( NodeGraph & nodeGraph, 23 | BFFParser & parser, 24 | const BFFToken * functionNameStart, 25 | const BFFTokenRange & headerRange, 26 | const BFFTokenRange & bodyRange ) const override; 27 | }; 28 | 29 | //------------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionVCXProject.cpp: -------------------------------------------------------------------------------- 1 | // FunctionVCXProject 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | // FBuild 7 | #include "FunctionVCXProject.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/VCXProjectNode.h" 10 | 11 | // Core 12 | #include "Core/Strings/AStackString.h" 13 | 14 | // CONSTRUCTOR 15 | //------------------------------------------------------------------------------ 16 | FunctionVCXProject::FunctionVCXProject() 17 | : Function( "VCXProject" ) 18 | { 19 | } 20 | 21 | // AcceptsHeader 22 | //------------------------------------------------------------------------------ 23 | /*virtual*/ bool FunctionVCXProject::AcceptsHeader() const 24 | { 25 | return true; 26 | } 27 | 28 | // CreateNode 29 | //------------------------------------------------------------------------------ 30 | /*virtual*/ Node * FunctionVCXProject::CreateNode() const 31 | { 32 | return FNEW( VCXProjectNode ); 33 | } 34 | 35 | //------------------------------------------------------------------------------ 36 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionVCXProject.h: -------------------------------------------------------------------------------- 1 | // FunctionVCXProject 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | 12 | // FunctionVCXProject 13 | //------------------------------------------------------------------------------ 14 | class FunctionVCXProject : public Function 15 | { 16 | public: 17 | explicit FunctionVCXProject(); 18 | inline virtual ~FunctionVCXProject() override = default; 19 | 20 | protected: 21 | virtual bool AcceptsHeader() const override; 22 | virtual Node * CreateNode() const override; 23 | }; 24 | 25 | //------------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionVSProjectExternal.cpp: -------------------------------------------------------------------------------- 1 | // FunctionVSProjectExternal 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "FunctionVSProjectExternal.h" 7 | 8 | // FBuild 9 | #include "Tools/FBuild/FBuildCore/Graph/VSProjectExternalNode.h" 10 | 11 | // CONSTRUCTOR 12 | //------------------------------------------------------------------------------ 13 | FunctionVSProjectExternal::FunctionVSProjectExternal() 14 | : Function( "VSProjectExternal" ) 15 | { 16 | } 17 | 18 | // AcceptsHeader 19 | //------------------------------------------------------------------------------ 20 | /*virtual*/ bool FunctionVSProjectExternal::AcceptsHeader() const 21 | { 22 | return true; 23 | } 24 | 25 | // CreateNode 26 | //------------------------------------------------------------------------------ 27 | /*virtual*/ Node * FunctionVSProjectExternal::CreateNode() const 28 | { 29 | return FNEW( VSProjectExternalNode ); 30 | } 31 | 32 | //------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionVSProjectExternal.h: -------------------------------------------------------------------------------- 1 | // FunctionVSProjectExternal 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | class BFFIterator; 12 | 13 | // FunctionVSProjectExternal 14 | //------------------------------------------------------------------------------ 15 | class FunctionVSProjectExternal : public Function 16 | { 17 | public: 18 | explicit FunctionVSProjectExternal(); 19 | inline virtual ~FunctionVSProjectExternal() override = default; 20 | 21 | protected: 22 | virtual bool AcceptsHeader() const override; 23 | virtual Node * CreateNode() const override; 24 | }; 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionVSSolution.cpp: -------------------------------------------------------------------------------- 1 | // FunctionVSSolution 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | // FBuild 7 | #include "FunctionVSSolution.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/SLNNode.h" 10 | 11 | // Core 12 | #include "Core/Strings/AStackString.h" 13 | 14 | // CONSTRUCTOR 15 | //------------------------------------------------------------------------------ 16 | FunctionVSSolution::FunctionVSSolution() 17 | : Function( "VSSolution" ) 18 | { 19 | } 20 | 21 | // AcceptsHeader 22 | //------------------------------------------------------------------------------ 23 | /*virtual*/ bool FunctionVSSolution::AcceptsHeader() const 24 | { 25 | return true; 26 | } 27 | 28 | // CreateNode 29 | //------------------------------------------------------------------------------ 30 | /*virtual*/ Node * FunctionVSSolution::CreateNode() const 31 | { 32 | return FNEW( SLNNode ); 33 | } 34 | 35 | //------------------------------------------------------------------------------ 36 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionVSSolution.h: -------------------------------------------------------------------------------- 1 | // FunctionVSSolution 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | 12 | // FunctionVSSolution 13 | //------------------------------------------------------------------------------ 14 | class FunctionVSSolution : public Function 15 | { 16 | public: 17 | explicit FunctionVSSolution(); 18 | inline virtual ~FunctionVSSolution() override = default; 19 | 20 | protected: 21 | virtual bool AcceptsHeader() const override; 22 | virtual Node *CreateNode() const override; 23 | }; 24 | 25 | //------------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionXCodeProject.cpp: -------------------------------------------------------------------------------- 1 | // FunctionXCodeProject 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | // FBuild 7 | #include "FunctionXCodeProject.h" 8 | #include "Tools/FBuild/FBuildCore/FBuild.h" 9 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 10 | #include "Tools/FBuild/FBuildCore/Graph/XCodeProjectNode.h" 11 | 12 | // Core 13 | #include "Core/Strings/AStackString.h" 14 | 15 | // CONSTRUCTOR 16 | //------------------------------------------------------------------------------ 17 | FunctionXCodeProject::FunctionXCodeProject() 18 | : Function( "XCodeProject" ) 19 | { 20 | } 21 | 22 | // AcceptsHeader 23 | //------------------------------------------------------------------------------ 24 | /*virtual*/ bool FunctionXCodeProject::AcceptsHeader() const 25 | { 26 | return true; 27 | } 28 | 29 | // CreateNode 30 | //------------------------------------------------------------------------------ 31 | /*virtual*/ Node * FunctionXCodeProject::CreateNode() const 32 | { 33 | return FNEW( XCodeProjectNode ); 34 | } 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Functions/FunctionXCodeProject.h: -------------------------------------------------------------------------------- 1 | // FunctionXCodeProject 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Function.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | 12 | // FunctionXCodeProject 13 | //------------------------------------------------------------------------------ 14 | class FunctionXCodeProject : public Function 15 | { 16 | public: 17 | explicit FunctionXCodeProject(); 18 | inline virtual ~FunctionXCodeProject() override = default; 19 | 20 | protected: 21 | virtual bool AcceptsHeader() const override; 22 | 23 | virtual Node * CreateNode() const override; 24 | }; 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/BFF/Tokenizer/BFFToken.natvis: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{pos: {m_Pos-m_Begin} - size: {m_End-m_Begin}}} 5 | 6 | m_Pos 7 | m_Begin 8 | m_End 9 | 10 | m_End-m_Pos 11 | m_Pos 12 | 13 | 14 | 15 | 16 | {{{m_Type,en} - {m_String.m_Contents,s}}} 17 | 18 | 19 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME FBuildCore) 2 | 3 | ucm_add_dirs( 4 | BFF 5 | Cache 6 | Graph 7 | Helpers 8 | Protocol 9 | WorkerPool 10 | TO SOURCES RECURSIVE) 11 | 12 | ucm_add_files( 13 | "Error.cpp" 14 | "Error.h" 15 | "FBuild.cpp" 16 | "FBuild.h" 17 | "FBuildOptions.h" 18 | "FBuildOptions.cpp" 19 | "FBuildVersion.h" 20 | "FLog.h" 21 | "FLog.cpp" 22 | TO SOURCES) 23 | 24 | add_library(${TARGET_NAME} STATIC ${SOURCES}) 25 | target_link_libraries(${TARGET_NAME} PUBLIC lz4) 26 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 27 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_HOME_DIRECTORY}/Code) 28 | 29 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Libs") -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Cache/ICache.cpp: -------------------------------------------------------------------------------- 1 | // ICache - Cache interface 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "ICache.h" 7 | 8 | #include 9 | 10 | // GetCacheId 11 | //------------------------------------------------------------------------------ 12 | /*static*/ void ICache::GetCacheId( const uint64_t preprocessedSourceKey, 13 | const uint32_t commandLineKey, 14 | const uint64_t toolChainKey, 15 | const uint64_t pchKey, 16 | AString & outCacheId ) 17 | { 18 | // cache version - bump if cache format is changed 19 | static const char cacheVersion( 'B' ); 20 | 21 | // format example: 2377DE32AB045A2D_FED872A1_AB62FEAA23498AAC-32A2B04375A2D7DE.7 22 | outCacheId.Format( "%016" PRIX64 "_%08X_%016" PRIX64 "-%016" PRIX64 ".%c", 23 | preprocessedSourceKey, 24 | commandLineKey, 25 | toolChainKey, 26 | pchKey, 27 | cacheVersion ); 28 | } 29 | 30 | //------------------------------------------------------------------------------ 31 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/FBuildVersion.h: -------------------------------------------------------------------------------- 1 | // FBuildVersion.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Defines 6 | //------------------------------------------------------------------------------ 7 | #define FBUILD_VERSION_STRING "v1.01" 8 | #define FBUILD_VERSION (uint32_t)101 9 | #if defined( __WINDOWS__ ) 10 | #define FBUILD_VERSION_PLATFORM "Windows" 11 | #elif defined( __APPLE__ ) 12 | #define FBUILD_VERSION_PLATFORM "OSX" 13 | #elif defined( __LINUX__ ) 14 | #define FBUILD_VERSION_PLATFORM "Linux" 15 | #else 16 | #error Unknown platform 17 | #endif 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/AliasNode.h: -------------------------------------------------------------------------------- 1 | // AliasNode.h - a node that groups together several targets under a new target 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Node.h" 8 | #include "Core/Containers/Array.h" 9 | 10 | // Forward Declarations 11 | //------------------------------------------------------------------------------ 12 | class Function; 13 | 14 | // AliasNode 15 | //------------------------------------------------------------------------------ 16 | class AliasNode : public Node 17 | { 18 | REFLECT_NODE_DECLARE( AliasNode ) 19 | public: 20 | explicit AliasNode(); 21 | virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * iter, const Function * function ) override; 22 | virtual ~AliasNode() override; 23 | 24 | static inline Node::Type GetTypeS() { return Node::ALIAS_NODE; } 25 | 26 | virtual bool IsAFile() const override { return false; } 27 | 28 | inline const Dependencies & GetAliasedNodes() const { return m_StaticDependencies; } 29 | 30 | private: 31 | virtual BuildResult DoBuild( Job * job ) override; 32 | 33 | Array< AString > m_Targets; 34 | }; 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/CopyFileNode.h: -------------------------------------------------------------------------------- 1 | // CopyFileNode.h - a node that copies a single object 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "FileNode.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | class Function; 12 | 13 | // CopyFileNode 14 | //------------------------------------------------------------------------------ 15 | class CopyFileNode : public FileNode 16 | { 17 | REFLECT_NODE_DECLARE( CopyFileNode ) 18 | public: 19 | explicit CopyFileNode(); 20 | virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * iter, const Function * function ) override; 21 | virtual ~CopyFileNode() override; 22 | 23 | static inline Node::Type GetTypeS() { return Node::COPY_FILE_NODE; } 24 | 25 | FileNode * GetSourceNode() const { return m_StaticDependencies[0].GetNode()->CastTo< FileNode >(); } 26 | 27 | private: 28 | virtual BuildResult DoBuild( Job * job ) override; 29 | 30 | void EmitCopyMessage() const; 31 | 32 | friend class FunctionCopy; 33 | friend class CopyDirNode; // TODO: Remove 34 | AString m_Source; 35 | AString m_Dest; 36 | Array< AString > m_PreBuildDependencyNames; 37 | }; 38 | 39 | //------------------------------------------------------------------------------ 40 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/DLLNode.h: -------------------------------------------------------------------------------- 1 | // DLLNode.h - builds a dll 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "LinkerNode.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | 12 | // DLLNode 13 | //------------------------------------------------------------------------------ 14 | class DLLNode : public LinkerNode 15 | { 16 | REFLECT_NODE_DECLARE( DLLNode ) 17 | public: 18 | explicit DLLNode(); 19 | virtual ~DLLNode() override; 20 | 21 | void GetImportLibName( AString & importLibName ) const; 22 | 23 | static inline Node::Type GetTypeS() { return Node::DLL_NODE; } 24 | 25 | }; 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/ExeNode.cpp: -------------------------------------------------------------------------------- 1 | // LinkerNode.cpp 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "ExeNode.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_NODE_BEGIN( ExeNode, LinkerNode, MetaNone() ) 11 | REFLECT_END( ExeNode ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | ExeNode::ExeNode() 16 | : LinkerNode() 17 | { 18 | m_Type = EXE_NODE; 19 | } 20 | 21 | // DESTRUCTOR 22 | //------------------------------------------------------------------------------ 23 | ExeNode::~ExeNode() = default; 24 | 25 | //------------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/ExeNode.h: -------------------------------------------------------------------------------- 1 | // ExeNode.h - builds an exe 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "LinkerNode.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | 12 | // ExeNode 13 | //------------------------------------------------------------------------------ 14 | class ExeNode : public LinkerNode 15 | { 16 | REFLECT_NODE_DECLARE( ExeNode ) 17 | public: 18 | explicit ExeNode(); 19 | virtual ~ExeNode() override; 20 | 21 | static inline Node::Type GetTypeS() { return Node::EXE_NODE; } 22 | }; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/FileNode.h: -------------------------------------------------------------------------------- 1 | // FileNode.h - a node that tracks a single file 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Node.h" 8 | 9 | // FileNode 10 | //------------------------------------------------------------------------------ 11 | class FileNode : public Node 12 | { 13 | public: 14 | explicit FileNode( const AString & fileName, uint32_t controlFlags ); 15 | virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * funcStartIter, const Function * function ) override; 16 | virtual ~FileNode() override; 17 | 18 | static inline Node::Type GetTypeS() { return Node::FILE_NODE; } 19 | 20 | virtual bool IsAFile() const override { return true; } 21 | 22 | static void HandleWarningsMSVC( Job * job, const AString & name, const AString & data ); 23 | static void HandleWarningsClangGCC( Job * job, const AString & name, const AString & data ); 24 | protected: 25 | friend class ObjectNode; 26 | virtual BuildResult DoBuild( Job * job ) override; 27 | 28 | static void DumpOutput( Job * job, const AString & buffer, const AString & name, bool treatAsWarnings = false ); 29 | 30 | friend class Client; 31 | }; 32 | 33 | //------------------------------------------------------------------------------ 34 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_AllowNonFile.cpp: -------------------------------------------------------------------------------- 1 | // Meta_AllowNonFile 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_AllowNonFile.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_AllowNonFile, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_AllowNonFile ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_AllowNonFile::Meta_AllowNonFile() = default; 16 | 17 | // CONSTRUCTOR 18 | //------------------------------------------------------------------------------ 19 | Meta_AllowNonFile::Meta_AllowNonFile( const Node::Type limitToType ) 20 | : m_LimitToTypeEnabled( true ) 21 | , m_LimitToType( limitToType ) 22 | { 23 | } 24 | 25 | // DESTRUCTOR 26 | //------------------------------------------------------------------------------ 27 | Meta_AllowNonFile::~Meta_AllowNonFile() = default; 28 | 29 | //------------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_AllowNonFile.h: -------------------------------------------------------------------------------- 1 | // Meta_AllowNonFile 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | #include "Tools/FBuild/FBuildCore/Graph/Node.h" 9 | 10 | // Meta_AllowNonFile 11 | //------------------------------------------------------------------------------ 12 | class Meta_AllowNonFile : public IMetaData 13 | { 14 | REFLECT_DECLARE( Meta_AllowNonFile ) 15 | public: 16 | // Allow any non-file nodes 17 | explicit Meta_AllowNonFile(); 18 | 19 | // Allow only the specific type of non-file node 20 | explicit Meta_AllowNonFile( const Node::Type limitToType ); 21 | 22 | virtual ~Meta_AllowNonFile() override; 23 | 24 | inline bool IsLimitedToType() const { return m_LimitToTypeEnabled; } 25 | inline Node::Type GetLimitedType() const { return m_LimitToType; } 26 | 27 | protected: 28 | bool m_LimitToTypeEnabled = false; 29 | Node::Type m_LimitToType; 30 | }; 31 | 32 | //------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_EmbedMembers.cpp: -------------------------------------------------------------------------------- 1 | // Meta_EmbedMembers 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_EmbedMembers.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_EmbedMembers, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_EmbedMembers ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_EmbedMembers::Meta_EmbedMembers() = default; 16 | 17 | // DESTRUCTOR 18 | //------------------------------------------------------------------------------ 19 | Meta_EmbedMembers::~Meta_EmbedMembers() = default; 20 | 21 | //------------------------------------------------------------------------------ 22 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_EmbedMembers.h: -------------------------------------------------------------------------------- 1 | // Meta_EmbedMembers 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_EmbedMembers 10 | //------------------------------------------------------------------------------ 11 | class Meta_EmbedMembers : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_EmbedMembers ) 14 | public: 15 | explicit Meta_EmbedMembers(); 16 | virtual ~Meta_EmbedMembers() override; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_IgnoreForComparison.cpp: -------------------------------------------------------------------------------- 1 | // Meta_IgnoreForComparison 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_IgnoreForComparison.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_IgnoreForComparison, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_IgnoreForComparison ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_IgnoreForComparison::Meta_IgnoreForComparison() = default; 16 | 17 | // DESTRUCTOR 18 | //------------------------------------------------------------------------------ 19 | Meta_IgnoreForComparison::~Meta_IgnoreForComparison() = default; 20 | 21 | //------------------------------------------------------------------------------ 22 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_IgnoreForComparison.h: -------------------------------------------------------------------------------- 1 | // Meta_IgnoreForComparison 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_InheritFromOwner 10 | //------------------------------------------------------------------------------ 11 | class Meta_IgnoreForComparison : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_IgnoreForComparison ) 14 | public: 15 | explicit Meta_IgnoreForComparison(); 16 | virtual ~Meta_IgnoreForComparison() override; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_InheritFromOwner.cpp: -------------------------------------------------------------------------------- 1 | // Meta_InheritFromOwner 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_InheritFromOwner.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_InheritFromOwner, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_InheritFromOwner ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_InheritFromOwner::Meta_InheritFromOwner() = default; 16 | 17 | // DESTRUCTOR 18 | //------------------------------------------------------------------------------ 19 | Meta_InheritFromOwner::~Meta_InheritFromOwner() = default; 20 | 21 | //------------------------------------------------------------------------------ 22 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_InheritFromOwner.h: -------------------------------------------------------------------------------- 1 | // Meta_InheritFromOwner 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | // Meta_InheritFromOwner 10 | //------------------------------------------------------------------------------ 11 | class Meta_InheritFromOwner : public IMetaData 12 | { 13 | REFLECT_DECLARE( Meta_InheritFromOwner ) 14 | public: 15 | explicit Meta_InheritFromOwner(); 16 | virtual ~Meta_InheritFromOwner() override; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_Name.cpp: -------------------------------------------------------------------------------- 1 | // Meta_Name 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Meta_Name.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_BEGIN( Meta_Name, IMetaData, MetaNone() ) 11 | REFLECT_END( Meta_Name ) 12 | 13 | // CONSTRUCTOR 14 | //------------------------------------------------------------------------------ 15 | Meta_Name::Meta_Name() 16 | { 17 | } 18 | 19 | // CONSTRUCTOR 20 | //------------------------------------------------------------------------------ 21 | Meta_Name::Meta_Name( const char * name ) 22 | : m_Name( name ) 23 | { 24 | } 25 | 26 | // DESTRUCTOR 27 | //------------------------------------------------------------------------------ 28 | Meta_Name::~Meta_Name() = default; 29 | 30 | //------------------------------------------------------------------------------ 31 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/MetaData/Meta_Name.h: -------------------------------------------------------------------------------- 1 | // Meta_Name.h 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/Reflection/MetaData/MetaDataInterface.h" 8 | 9 | #include "Core/Strings/AString.h" 10 | 11 | // Meta_Name 12 | //------------------------------------------------------------------------------ 13 | class Meta_Name : public IMetaData 14 | { 15 | REFLECT_DECLARE( Meta_Name ) 16 | public: 17 | explicit Meta_Name(); 18 | explicit Meta_Name( const char * name ); 19 | virtual ~Meta_Name() override; 20 | 21 | inline const AString & GetName() const { return m_Name; } 22 | 23 | protected: 24 | AString m_Name; 25 | }; 26 | 27 | //------------------------------------------------------------------------------ 28 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/Node.natvis: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ type: {Node::s_NodeTypeNames[m_Type],s}, name: {m_Name.m_Contents,s} }} 5 | 6 | 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/NodeProxy.h: -------------------------------------------------------------------------------- 1 | // NodeProxy.h - a remote proxy for remote builds 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Node.h" 8 | 9 | // FBuild 10 | //------------------------------------------------------------------------------ 11 | class NodeProxy : public Node 12 | { 13 | public: 14 | explicit NodeProxy( const AString & name ); 15 | virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * funcStartIter, const Function * function ) override; 16 | virtual ~NodeProxy() override; 17 | 18 | virtual bool IsAFile() const override; 19 | 20 | protected: 21 | virtual bool DetermineNeedToBuild( const Dependencies & deps ) const override; 22 | }; 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/RemoveDirNode.h: -------------------------------------------------------------------------------- 1 | // RemoveDirNode.h - a node that removes one or more directories 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Node.h" 8 | 9 | // Forward Declarations 10 | //------------------------------------------------------------------------------ 11 | 12 | // RemoveDirNode 13 | //------------------------------------------------------------------------------ 14 | class RemoveDirNode : public Node 15 | { 16 | REFLECT_NODE_DECLARE( RemoveDirNode ) 17 | public: 18 | explicit RemoveDirNode(); 19 | virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * iter, const Function * function ) override; 20 | virtual ~RemoveDirNode() override; 21 | 22 | static inline Node::Type GetTypeS() { return Node::REMOVE_DIR_NODE; } 23 | virtual bool IsAFile() const override; 24 | 25 | private: 26 | virtual BuildResult DoBuild( Job * job ) override; 27 | 28 | // Exposed Properties 29 | Array< AString > m_RemovePaths; 30 | bool m_RemovePathsRecurse; 31 | Array< AString > m_RemovePatterns; 32 | Array< AString > m_RemoveExcludePaths; 33 | Array< AString > m_PreBuildDependencyNames; 34 | }; 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/TextFileNode.h: -------------------------------------------------------------------------------- 1 | // TextFileNode 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "FileNode.h" 8 | #include "Core/Containers/Array.h" 9 | 10 | // Forward Declarations 11 | //------------------------------------------------------------------------------ 12 | 13 | // TextFileNode 14 | //------------------------------------------------------------------------------ 15 | class TextFileNode : public FileNode 16 | { 17 | REFLECT_NODE_DECLARE( TextFileNode ) 18 | public: 19 | explicit TextFileNode(); 20 | virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * iter, const Function * function ) override; 21 | virtual ~TextFileNode() override; 22 | 23 | static inline Node::Type GetTypeS() { return Node::TEXT_FILE_NODE; } 24 | 25 | private: 26 | virtual bool DetermineNeedToBuild( const Dependencies & deps ) const override; 27 | virtual BuildResult DoBuild( Job * job ) override; 28 | 29 | void EmitCompilationMessage() const; 30 | 31 | // Exposed Properties 32 | AString m_TextFileOutput; 33 | Array< AString > m_TextFileInputStrings; 34 | bool m_TextFileAlways; 35 | Array< AString > m_PreBuildDependencyNames; 36 | }; 37 | 38 | //------------------------------------------------------------------------------ 39 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Graph/VSProjectBaseNode.cpp: -------------------------------------------------------------------------------- 1 | // VSProjectBaseNode.cpp 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "VSProjectBaseNode.h" 7 | 8 | // Reflection 9 | //------------------------------------------------------------------------------ 10 | REFLECT_NODE_BEGIN_ABSTRACT( VSProjectBaseNode, Node, MetaNone() ) 11 | REFLECT( m_ProjectGuid, "ProjectGuid", MetaOptional() ) 12 | REFLECT_END( VSProjectBaseNode ) 13 | 14 | // CONSTRUCTOR 15 | //------------------------------------------------------------------------------ 16 | VSProjectBaseNode::VSProjectBaseNode() 17 | : FileNode( AString::GetEmpty(), Node::FLAG_ALWAYS_BUILD ) 18 | { 19 | m_LastBuildTimeMs = 100; // higher default than a file node 20 | } 21 | 22 | // DESTRUCTOR 23 | //------------------------------------------------------------------------------ 24 | VSProjectBaseNode::~VSProjectBaseNode() = default; 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Helpers/CtrlCHandler.h: -------------------------------------------------------------------------------- 1 | // CtrlCHandler 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // CtrlCHandler 6 | //------------------------------------------------------------------------------ 7 | class CtrlCHandler 8 | { 9 | public: 10 | CtrlCHandler(); 11 | ~CtrlCHandler(); 12 | 13 | void RegisterHandler(); 14 | void DeregisterHandler(); 15 | private: 16 | bool m_IsRegistered = false; 17 | }; 18 | 19 | //------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Helpers/MultiBuffer.h: -------------------------------------------------------------------------------- 1 | // MultiBuffer 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | // Core 8 | #include "Core/Containers/Array.h" 9 | #include "Core/Env/Types.h" 10 | 11 | // Forward Declarations 12 | //------------------------------------------------------------------------------ 13 | class AString; 14 | class ConstMemoryStream; 15 | class MemoryStream; 16 | 17 | // MultiBuffer 18 | //------------------------------------------------------------------------------ 19 | class MultiBuffer 20 | { 21 | public: 22 | MultiBuffer(); 23 | explicit MultiBuffer( const void * data, size_t dataSize ); 24 | ~MultiBuffer(); 25 | 26 | bool CreateFromFiles( const Array< AString > & fileNames, size_t * outProblemFileIndex = nullptr ); 27 | bool ExtractFile( size_t index, const AString& fileName ) const; 28 | 29 | const void * GetData() const; 30 | uint64_t GetDataSize() const; 31 | 32 | void * Release( size_t & outSize ); 33 | 34 | private: 35 | enum : uint32_t { MAX_FILES = 4 }; 36 | 37 | ConstMemoryStream * m_ReadStream; 38 | MemoryStream * m_WriteStream; 39 | }; 40 | 41 | //------------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/Helpers/ResponseFile.h: -------------------------------------------------------------------------------- 1 | // ResponseFile 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "Core/FileIO/FileStream.h" 8 | #include "Core/Strings/AStackString.h" 9 | 10 | // Forward Declarations 11 | //------------------------------------------------------------------------------ 12 | class Args; 13 | class AString; 14 | 15 | // ResponseFile 16 | //------------------------------------------------------------------------------ 17 | class ResponseFile 18 | { 19 | public: 20 | explicit ResponseFile(); 21 | ~ResponseFile(); 22 | 23 | bool Create( const Args & args ); 24 | bool Create( const AString & contents ); 25 | const AString & GetResponseFilePath() const { return m_ResponseFilePath; } 26 | 27 | void SetEscapeSlashes() { m_EscapeSlashes = true; } 28 | private: 29 | bool CreateInternal( const AString & contents ); 30 | 31 | FileStream m_File; 32 | AStackString<> m_ResponseFilePath; 33 | bool m_EscapeSlashes; 34 | }; 35 | 36 | //------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildCore/WorkerPool/WorkerThreadRemote.h: -------------------------------------------------------------------------------- 1 | // WorkerThreadRemote - object to process and manage jobs on a remote thread 2 | //------------------------------------------------------------------------------ 3 | #pragma once 4 | 5 | // Includes 6 | //------------------------------------------------------------------------------ 7 | #include "WorkerThread.h" 8 | #include "Core/Process/Mutex.h" 9 | 10 | // Forward Declarations 11 | //------------------------------------------------------------------------------ 12 | class Job; 13 | 14 | // WorkerThread 15 | //------------------------------------------------------------------------------ 16 | class WorkerThreadRemote : public WorkerThread 17 | { 18 | public: 19 | explicit WorkerThreadRemote( uint32_t threadIndex ); 20 | virtual ~WorkerThreadRemote() override; 21 | 22 | void GetStatus( AString & hostName, AString & status, bool & isIdle ) const; 23 | 24 | // control remote CPU usage 25 | static void SetNumCPUsToUse( uint32_t c ) { s_NumCPUsToUse = c; } 26 | static uint32_t GetNumCPUsToUse() { return s_NumCPUsToUse; } 27 | private: 28 | virtual void Main() override; 29 | 30 | bool IsEnabled() const; 31 | 32 | mutable Mutex m_CurrentJobMutex; 33 | Job * m_CurrentJob; 34 | 35 | // static 36 | static uint32_t s_NumCPUsToUse; 37 | }; 38 | 39 | //------------------------------------------------------------------------------ 40 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestBuildAndLinkLibrary/a.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "a.h" 3 | ClassA::ClassA() 4 | : m_Int( 0 ) 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestBuildAndLinkLibrary/a.h: -------------------------------------------------------------------------------- 1 | 2 | class ClassA 3 | { 4 | public: 5 | ClassA(); 6 | 7 | inline int FunctionA() const { return m_Int; } 8 | private: 9 | int m_Int; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestBuildAndLinkLibrary/b.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "b.h" 3 | 4 | ClassB::ClassB() 5 | : m_Int( 1 ) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestBuildAndLinkLibrary/b.h: -------------------------------------------------------------------------------- 1 | 2 | class ClassB 3 | { 4 | public: 5 | ClassB(); 6 | 7 | inline int FunctionA() const { return m_Int; } 8 | private: 9 | int m_Int; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestBuildAndLinkLibrary/c.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "c.h" 3 | 4 | ClassC::ClassC() 5 | : m_Int( 2 ) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestBuildAndLinkLibrary/c.h: -------------------------------------------------------------------------------- 1 | 2 | class ClassC 3 | { 4 | public: 5 | ClassC(); 6 | 7 | inline int FunctionC() const { return m_Int; } 8 | private: 9 | int m_Int; 10 | }; 11 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCLR/a.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "a.h" 3 | 4 | // A managed class, which creates an unmanaged object 5 | ref class AMaker 6 | { 7 | public: 8 | AMaker() {} 9 | A * MakeA() 10 | { 11 | A* a = new A; 12 | a->value = 15613223; // test will check for this value 13 | return a; 14 | } 15 | }; 16 | 17 | // A function which uses CLR, exposed (in the header) via the C++ interface 18 | A * FunctionsAsCLR_A() 19 | { 20 | // use garbage collected new/clr methods 21 | AMaker^ aMaker = gcnew AMaker; 22 | return aMaker->MakeA(); 23 | } 24 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCLR/a.h: -------------------------------------------------------------------------------- 1 | 2 | // a regular class 3 | class A 4 | { 5 | public: 6 | A() { value = 0; } 7 | 8 | int value; 9 | }; 10 | 11 | // A CLR function (accessible from C++) 12 | A * FunctionsAsCLR_A(); 13 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCLR/b.cpp: -------------------------------------------------------------------------------- 1 | 2 | // a managed type 3 | ref class B 4 | { 5 | public: 6 | int i; 7 | }; 8 | 9 | void FunctionsAsCLR_B() 10 | { 11 | // use garbage collected new 12 | B^ b = gcnew B; 13 | (void)b; 14 | } 15 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCLR/c.cpp: -------------------------------------------------------------------------------- 1 | 2 | // a managed type 3 | ref class C 4 | { 5 | public: 6 | int i; 7 | }; 8 | 9 | void FunctionsAsCLR_C() 10 | { 11 | // use garbage collected new 12 | C^ c = gcnew C; 13 | (void)c; 14 | } 15 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCLR/exe.cxx: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "a.h" 4 | 5 | A* CLRCaller() 6 | { 7 | return FunctionsAsCLR_A(); 8 | } 9 | 10 | extern "C" 11 | { 12 | int ExeMain(void) 13 | { 14 | // call code in the CLR library 15 | A * a = CLRCaller(); 16 | 17 | return a->value; // test will check this 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCSharp/a.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace NamespaceA 3 | { 4 | public class ClassA 5 | { 6 | public static void FuncA() {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCSharp/b.cs: -------------------------------------------------------------------------------- 1 | 2 | using NamespaceA; 3 | 4 | namespace NamespaceB 5 | { 6 | public class ClassB 7 | { 8 | public static void FuncB() { ClassA.FuncA(); } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCSharp/c.cs: -------------------------------------------------------------------------------- 1 | 2 | using NamespaceA; 3 | using NamespaceB; 4 | 5 | namespace NamespaceC 6 | { 7 | public class ClassC 8 | { 9 | public static void FuncC() { ClassA.FuncA(); ClassB.FuncB(); } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCSharp/dummy.csnot: -------------------------------------------------------------------------------- 1 | Dummy file to ensure *.cs pattern correctly ignores this file -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCUDA/test.cu: -------------------------------------------------------------------------------- 1 | // 2 | // Simple cuda test code 3 | // 4 | 5 | __global__ void increment(int *a) 6 | { 7 | a[threadIdx.x] += 1; // b[threadIdx.x]; 8 | } 9 | 10 | int main() 11 | { 12 | const int dataSize = 16; 13 | int a[dataSize] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16}; 14 | 15 | // allocate work buffer 16 | int *ad; 17 | const int bufferSize = dataSize * sizeof(int); 18 | cudaMalloc( (void**)&ad, bufferSize ); 19 | 20 | // copy input to work buffer 21 | cudaMemcpy( ad, a, bufferSize, cudaMemcpyHostToDevice ); 22 | 23 | // do increments 24 | dim3 dimBlock( dataSize, 1 ); 25 | dim3 dimGrid( 1, 1 ); 26 | increment<<>>(ad); 27 | 28 | // copy back result 29 | cudaMemcpy( a, ad, bufferSize, cudaMemcpyDeviceToHost ); 30 | 31 | // cleanup 32 | cudaFree( ad ); 33 | 34 | return 0; 35 | } -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/Analyze_MSVC/file1.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // MSVC Static Analysis can detect errors such as buffer overruns 3 | // with no annotation 4 | // 5 | #define BUFFER_SIZE 32 6 | 7 | void Func() 8 | { 9 | char buffer[ BUFFER_SIZE ]; 10 | 11 | // Out of bounds array access 12 | buffer[ BUFFER_SIZE ] = '\0'; 13 | } 14 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/Analyze_MSVC/file2.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // MSVC can detect some usage errors for code annotated with SAL 3 | // 4 | 5 | // 6 | // This header will conditionally enable SAL depending on the _PREFAST_ 7 | // define 8 | // 9 | #include 10 | 11 | void Func() 12 | { 13 | std::string s( nullptr ); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/ConsistentCacheKeys/file1.cpp: -------------------------------------------------------------------------------- 1 | 2 | void EmptyFunc() 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_CyclicInclude/file1.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "header1.h" 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_CyclicInclude/file1.h: -------------------------------------------------------------------------------- 1 | 2 | #include "file2.h" 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_CyclicInclude/file2.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "header1.h" 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_CyclicInclude/file2.h: -------------------------------------------------------------------------------- 1 | 2 | #include "file1.h" 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_CyclicInclude/header1.h: -------------------------------------------------------------------------------- 1 | 2 | #define HEADER1_INCLUDED 3 | #include "header2.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_CyclicInclude/header2.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER1_INCLUDED 3 | #include "header1.h" 4 | #endif 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_ImportDirective/file.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // LightCache does not support #import directives. 3 | // But it should detect this case and safely fall back to regular cache. 4 | // 5 | //------------------------------------------------------------------------------ 6 | #if 0 // We don't want to actually compile an #import directive. Compilation can fail for multiple unrelated reasons and we don't want false positives in tests. 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/Folder1/file.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/Folder1/file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/Folder1/file.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/Folder2/file.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/Folder2/file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/Folder2/file.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeHierarchy/common.h: -------------------------------------------------------------------------------- 1 | #include "file.h" -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.1.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define PATH_AS_MACRO "file.1.h" 3 | #include "file.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.1.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.2.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define PATH_AS_MACRO "file.2.h" 3 | #include "file.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.2.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro/file.h: -------------------------------------------------------------------------------- 1 | // An include defined previously 2 | #include PATH_AS_MACRO 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro2/file.1.cpp: -------------------------------------------------------------------------------- 1 | 2 | // header1 defines a macro 3 | #include "header1.h" 4 | 5 | // now we include via the macro 6 | #include INCLUDE_VIA_MACRO 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro2/file.2.cpp: -------------------------------------------------------------------------------- 1 | 2 | // header1 defines a macro 3 | #include "header1.h" 4 | 5 | // now we include via the macro 6 | #include INCLUDE_VIA_MACRO 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro2/header1.h: -------------------------------------------------------------------------------- 1 | 2 | // define macro for use by file that includes this header 3 | #define INCLUDE_VIA_MACRO "header2.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro2/header2.h: -------------------------------------------------------------------------------- 1 | 2 | // Empty 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro3/file.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define INCLUDE1 "header1.h" 3 | #define INCLUDE2 "header2.h" 4 | 5 | #include INCLUDE1 6 | #include INCLUDE2 7 | 8 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro3/header1.h: -------------------------------------------------------------------------------- 1 | 2 | // Create a bunch of extra defines that need to be tracked 3 | // (enough to ensure define storage we are iterating resizes) 4 | #define UNUSED_INCLUDEA "headerA.h" 5 | #define UNUSED_INCLUDEB "headerB.h" 6 | #define UNUSED_INCLUDEC "headerC.h" 7 | #define UNUSED_INCLUDED "headerD.h" 8 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/LightCache_IncludeUsingMacro3/header2.h: -------------------------------------------------------------------------------- 1 | 2 | // Empty 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/a.cpp: -------------------------------------------------------------------------------- 1 | #include "string.h" 2 | 3 | const char * FunctionA() 4 | { 5 | return "FunctionAString"; 6 | } 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCache/b.cpp: -------------------------------------------------------------------------------- 1 | #include "string.h" 2 | 3 | const char * FunctionB() 4 | { 5 | return "FunctionBString"; 6 | } 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCachePlugin/TestA.cpp: -------------------------------------------------------------------------------- 1 | 2 | int Function() 3 | { 4 | return 100; 5 | } 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompilationDatabase/clang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCompilationDatabase/clang -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompilationDatabase/dir/subdir/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCompilationDatabase/dir/subdir/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompiler/Explicit/PlaceholderForClang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCompiler/Explicit/PlaceholderForClang -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompiler/Implicit/PlaceholderForClang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCompiler/Implicit/PlaceholderForClang -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompiler/SimpleCompiler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple compiler that takes an input filename and output filename and creates the output file 3 | // 4 | #include 5 | 6 | int main(int argc, char ** argv) 7 | { 8 | if (argc != 3) 9 | { 10 | printf("Bad Args!\n"); 11 | return 1; 12 | } 13 | 14 | //const char* input = argv[1]; 15 | const char* output = argv[2]; 16 | 17 | FILE* f = fopen(output, "wb"); 18 | fwrite((char*)&argc, sizeof(argc), 1, f); 19 | fclose(f); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompiler/exe.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple executable to build 3 | // 4 | 5 | int main(int, char **) 6 | { 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCompressor/TestObjFile.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCompressor/TestObjFile.o -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/MissingTrailingSlash/a.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/MissingTrailingSlash/a.txt -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/MissingTrailingSlash/b.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/MissingTrailingSlash/b.txt -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/ObjectListChaining/file.1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/ObjectListChaining/file.1.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/ObjectListChaining/file.2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/ObjectListChaining/file.2.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/ObjectListChaining2/file.1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/ObjectListChaining2/file.1.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/a.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/a.txt -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestCopy/b.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestCopy/b.txt -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | #include "PrecompiledHeader.h" 2 | 3 | void FunctionInPCH() 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/PrecompiledHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // Some exported functions 3 | // 4 | #if defined( __WINDOWS__ ) 5 | __declspec(dllexport) void FunctionInPCH(); 6 | #endif 7 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/a.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Some exported functions 3 | // 4 | #include 5 | #include "a.h" 6 | 7 | int FunctionA() 8 | { 9 | return 99; // Checked for in unit test 10 | } 11 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/a.h: -------------------------------------------------------------------------------- 1 | // 2 | // Some exported functions 3 | // 4 | #if defined( __WINDOWS__ ) 5 | #if defined( DLL_A_EXPORT ) 6 | __declspec(dllexport) int FunctionA(); 7 | #else 8 | __declspec(dllimport) int FunctionA(); 9 | #endif 10 | #else 11 | int FunctionA(); 12 | #endif 13 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/b.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Some exported functions 3 | // 4 | #include "b.h" 5 | 6 | void FunctionB() 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/b.h: -------------------------------------------------------------------------------- 1 | // 2 | // Some exported functions 3 | // 4 | #if defined( __WINDOWS__ ) 5 | #if defined( DLL_B_EXPORT ) 6 | __declspec(dllexport) void FunctionB(); 7 | #else 8 | __declspec(dllimport) void FunctionB(); 9 | #endif 10 | #else 11 | void FunctionB(); 12 | #endif 13 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDLL/exe.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An executable using a DLL 3 | // 4 | 5 | // Include for the DLL 6 | #include "a.h" 7 | 8 | int main(int, char**) 9 | { 10 | return FunctionA(); 11 | } 12 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/AnonymousNamespaces/A/file.cpp: -------------------------------------------------------------------------------- 1 | namespace 2 | { 3 | int AnonFunction() 4 | { 5 | return 7; 6 | } 7 | } 8 | 9 | class A 10 | { 11 | public: 12 | static int Function() 13 | { 14 | return AnonFunction(); 15 | } 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/AnonymousNamespaces/B/file.cpp: -------------------------------------------------------------------------------- 1 | namespace 2 | { 3 | int AnonFunction() 4 | { 5 | return 7; 6 | } 7 | } 8 | 9 | class B 10 | { 11 | public: 12 | static int Function() 13 | { 14 | return AnonFunction(); 15 | } 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/BadCode/ErrorWithPercent.cpp: -------------------------------------------------------------------------------- 1 | 2 | void Function() 3 | { 4 | // this invalid code generates a compile error with % in it 5 | // which was causing a crash due to unsfae string formatting 6 | int %s%s%s%s 7 | } 8 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/ErrorsAreCorrectlyReported/Error.cpp: -------------------------------------------------------------------------------- 1 | // Deliberate compile error 2 | void X() 3 | { 4 | int x // Compile error 5 | } 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/ForceInclude/a.cpp: -------------------------------------------------------------------------------- 1 | 2 | void Function() 3 | { 4 | // Use a class we haven't included the declaration for 5 | // We are relying on /FI (Force Include) 6 | X x; 7 | x.m_Value = 7; 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/ForceInclude/a.h: -------------------------------------------------------------------------------- 1 | 2 | class X 3 | { 4 | public: 5 | X() = default; 6 | 7 | int m_Value; 8 | }; 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | #include "PrecompiledHeader.h" 2 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/PrecompiledHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestDistributed/PrecompiledHeader.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/RemoteRaceWinRemote/Fast.cpp: -------------------------------------------------------------------------------- 1 | #include "SlowTemplate.h" 2 | 3 | inline int SlowFunc1() { return FibSlow_t<0,17>::value; } 4 | inline int SlowFunc2() { return FibSlow_t<1,14>::value; } 5 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/RemoteRaceWinRemote/Slow.cpp: -------------------------------------------------------------------------------- 1 | #include "SlowTemplate.h" 2 | 3 | inline int SlowFunc1() { return FibSlow_t<0,18>::value; } 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/RemoteRaceWinRemote/SlowTemplate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // A deliberately slow thing to compile, so we can easily see when the 4 | // precompilation is working. 5 | // 6 | // Adapted from: https://randomascii.wordpress.com/2014/03/10/making-compiles-slow/ 7 | // 8 | template 9 | struct FibSlow_t 10 | { 11 | enum { value = FibSlow_t::value + 12 | FibSlow_t::value, }; 13 | }; 14 | 15 | // Explicitly specialized for N==2 16 | template struct FibSlow_t { enum { value = 1 }; }; 17 | 18 | // Explicitly specialized for N==1 19 | template struct FibSlow_t { enum { value = 1 }; }; 20 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/ShutdownMemoryLeak/a.cpp: -------------------------------------------------------------------------------- 1 | 2 | void Function() 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/WarningsAreCorrectlyReported/Warning.cpp: -------------------------------------------------------------------------------- 1 | // Deliberate warning 2 | void X() 3 | { 4 | int x; // Unused variable 5 | } 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/Zi/a.cpp: -------------------------------------------------------------------------------- 1 | 2 | bool __stdcall DllMain( void * hinstDLL, unsigned int fdwReason, void * lpvReserved ) 3 | { 4 | return true; 5 | } 6 | 7 | int Function() 8 | { 9 | return 100; 10 | } 11 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/a_normal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestDistributed/a_normal.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/a_pch.cpp: -------------------------------------------------------------------------------- 1 | #include "PrecompiledHeader.h" 2 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/b_normal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestDistributed/b_normal.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/b_pch.cpp: -------------------------------------------------------------------------------- 1 | #include "PrecompiledHeader.h" 2 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/c_normal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestDistributed/c_normal.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestDistributed/c_pch.cpp: -------------------------------------------------------------------------------- 1 | #include "PrecompiledHeader.h" 2 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestExe/exe.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple executable to run 3 | // 4 | 5 | int main(int, char **) 6 | { 7 | return 99; // test will check this 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestExec/exec.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple executable to run 3 | // 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char *argv[], char *[]) 9 | { 10 | // Touch each file listed 11 | for (int i = 1; i < argc; ++i) 12 | { 13 | const char * arg = argv[i]; 14 | 15 | // Make a new filename based on the input 16 | std::string outFileName = arg; 17 | outFileName += ".out"; 18 | 19 | // Touch the file 20 | std::ofstream file; 21 | file.open(outFileName); 22 | file << "T"; 23 | file.close(); 24 | 25 | // Generate some output 26 | // on STDOUT based on the arguments too 27 | std::cout << "Touched: " << outFileName << std::endl; 28 | } 29 | 30 | return argc - 1; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestGraph/NoStopOnFirstError/a.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error FAIL 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestGraph/NoStopOnFirstError/b.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error FAIL 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestGraph/NoStopOnFirstError/c.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error FAIL 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestGraph/NoStopOnFirstError/d.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error FAIL 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestGraph/library.cpp: -------------------------------------------------------------------------------- 1 | 2 | void Function() 3 | { 4 | } 5 | 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestGraph/library.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestGraph/library.o -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestIncludeParser/MSVC-P/test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestIncludeParser/MSVC-P/test.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestIncludeParser/MSVC-ShowIncludes/WithWarnings.output: -------------------------------------------------------------------------------- 1 | badfile.cpp 2 | C:\Test\Code\badfile.cpp(7) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 3 | 4 | \\localhost\Test\fake 2.h(4): warning C4005: 'B': macro redefinition 5 | \\localhost\Test\fake 2.h(3): note: see previous definition of 'B' 6 | 7 | c:\users\franta\documents\visual studio 2015\projects\showincludes\showincludes.cpp(6): warning C4005: 'X': macro redefinition 8 | c:\users\franta\documents\visual studio 2015\projects\showincludes\showincludes.cpp(5): note: see previous definition of 'X' 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/dummy1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/dummy1.lib -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/dummy2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/dummy2.lib -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/libdummy1.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/libdummy1.a -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/libdummy2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestLinker/LibrariesOnCommandLine/libdummy2.a -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObject/CacheUsingRelativePaths/File.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Subdir/Header.h" 3 | 4 | const char* Function() 5 | { 6 | // .obj file will contain filename, surrounded by these tokens 7 | return "FILE_MACRO_START_2(" __FILE__ ")FILE_MACRO_END_2"; 8 | } 9 | 10 | const char* Function2() 11 | { 12 | return GetFile(); // From included header 13 | } -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObject/CacheUsingRelativePaths/Subdir/Header.h: -------------------------------------------------------------------------------- 1 | 2 | inline const char* GetFile() 3 | { 4 | // .obj file will contain filename, surrounded by these tokens 5 | return "FILE_MACRO_START_1(" __FILE__ ")FILE_MACRO_END_1"; 6 | } -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObject/CustomPreprocessor/a.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // The token below will be replaced by our special preprocessor 3 | // 4 | unsigned long long Function() 5 | { 6 | return THING_TO_REPLACE; 7 | } 8 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObject/StaleDynamicDeps/CPPGeneratorMain.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main(int argc, const char** argv) 6 | { 7 | if ( argc != 3 ) 8 | { 9 | printf("Bad Args!\n"); 10 | return 1; 11 | } 12 | 13 | const char* input = argv[1]; 14 | const char* output = argv[2]; 15 | 16 | // Open source - emulate what a generator would do (scanning source file) 17 | { 18 | FILE* f = fopen(input, "rb"); 19 | if (!f) 20 | { 21 | printf("Failed to open input file '%s'\n", input); 22 | return 4; 23 | } 24 | fclose(f); 25 | } 26 | 27 | // Generate CPP file which includes header file 28 | char buffer[1024]; 29 | sprintf(buffer, "#include \"%s\"\n", input); 30 | 31 | // Create output 32 | { 33 | FILE* f = fopen(output, "wb"); 34 | if (!f) 35 | { 36 | printf("Failed to open output '%s'\n", output); 37 | return 2; 38 | } 39 | if (fwrite(buffer, 1, strlen(buffer), f) != strlen(buffer)) 40 | { 41 | fclose(f); 42 | printf("Failed to write to '%s'\n", output); 43 | return 3; 44 | } 45 | fclose(f); 46 | } 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/CompilerInputFilesRoot/A/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/CompilerInputFilesRoot/A/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/CompilerInputFilesRoot/B/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/CompilerInputFilesRoot/B/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ConflictingObjects/A/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ConflictingObjects/A/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ConflictingObjects/B/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ConflictingObjects/B/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/Exclusions/ignore.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error This file should not be compiled 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/Exclusions/ok.cpp: -------------------------------------------------------------------------------- 1 | // simple valid file 2 | void Function() 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ExtraOutputPaths/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ExtraOutputPaths/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ObjectListChaining/file.1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ObjectListChaining/file.1.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ObjectListChaining/file.2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestObjectList/ObjectListChaining/file.2.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheAnalyze_MSVC/A.cpp: -------------------------------------------------------------------------------- 1 | 2 | // This cpp file uses the precompiled header 3 | 4 | #include 5 | 6 | int main(int, char *[]) 7 | { 8 | return SPECIAL_DEFINE; 9 | } 10 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheAnalyze_MSVC/B.cpp: -------------------------------------------------------------------------------- 1 | 2 | // This cpp file uses the precompiled header 3 | 4 | #include 5 | 6 | int main(int, char *[]) 7 | { 8 | return SPECIAL_DEFINE; 9 | } 10 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheAnalyze_MSVC/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheAnalyze_MSVC/PrecompiledHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_INCLUDED 2 | #define PCH_INCLUDED 3 | 4 | // A define which is not used within the PCH, but should still uniquify the output 5 | // because files compiled using the PCH might rely on the define 6 | #define SPECIAL_DEFINE 1 7 | 8 | #endif // PCH_INCLUDED 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness/PCHUser.cpp: -------------------------------------------------------------------------------- 1 | 2 | // This cpp file uses the precompiled header 3 | 4 | #include 5 | 6 | int main(int, char *[]) 7 | { 8 | return SPECIAL_DEFINE; 9 | } 10 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness/PrecompiledHeaderA.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_INCLUDED 2 | #define PCH_INCLUDED 3 | 4 | // A define which is not used within the PCH, but should still uniquify the output 5 | // because files compiled using the PCH might rely on the define 6 | #define SPECIAL_DEFINE 1 7 | 8 | #endif // PCH_INCLUDED 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness/PrecompiledHeaderB.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_INCLUDED 2 | #define PCH_INCLUDED 3 | 4 | // A define which is not used within the PCH, but should still uniquify the output 5 | // because files compiled using the PCH might rely on the define 6 | #define SPECIAL_DEFINE 2 7 | 8 | #endif // PCH_INCLUDED 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness2/A.cpp: -------------------------------------------------------------------------------- 1 | 2 | // This cpp file uses the precompiled header 3 | 4 | #include 5 | 6 | int main(int, char *[]) 7 | { 8 | return SPECIAL_DEFINE; 9 | } 10 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness2/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/CacheUniqueness2/PrecompiledHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_INCLUDED 2 | #define PCH_INCLUDED 3 | 4 | // A define which is not used within the PCH, but should still uniquify the output 5 | // because files compiled using the PCH might rely on the define 6 | #define SPECIAL_DEFINE 1 7 | 8 | #endif // PCH_INCLUDED 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/Deoptimization/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/Deoptimization/PrecompiledHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_INCLUDED 2 | #define PCH_INCLUDED 3 | 4 | // A define which is not used within the PCH, but should still uniquify the output 5 | // because files compiled using the PCH might rely on the define 6 | #define SPECIAL_DEFINE 1 7 | 8 | #endif // PCH_INCLUDED 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHOnly/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHOnly/PrecompiledHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHOnly/PrecompiledHeader.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHReuse/FileA.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "PrecompiledHeader.h" 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHReuse/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHReuse/PrecompiledHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHReuse/PrecompiledHeader.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PCHUser.cpp: -------------------------------------------------------------------------------- 1 | 2 | // This cpp file uses the precompiled header 3 | 4 | #include 5 | 6 | int main(int, char *[]) 7 | { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | 2 | // The cpp file is used to create the precompiled header 3 | #include "PrecompiledHeader.h" 4 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/PrecompiledHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_INCLUDED 2 | #define PCH_INCLUDED 3 | 4 | // This .h will be pre-compiled 5 | 6 | #include "Slow.h" 7 | 8 | #endif // PCH_INCLUDED 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestPrecompiledHeaders/Slow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // A deliberately slow thing to compile, so we can easily see when the 4 | // precompilation is working. 5 | // 6 | // Adapted from: https://randomascii.wordpress.com/2014/03/10/making-compiles-slow/ 7 | // 8 | template 9 | struct FibSlow_t 10 | { 11 | enum { value = FibSlow_t::value + 12 | FibSlow_t::value, }; 13 | }; 14 | 15 | // Explicitly specialized for N==2 16 | template struct FibSlow_t { enum { value = 1 }; }; 17 | 18 | // Explicitly specialized for N==1 19 | template struct FibSlow_t { enum { value = 1 }; }; 20 | 21 | inline int SlowFunc2() { return FibSlow_t<0,18>::value; } 22 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestProjectGeneration/Solution_Items/dummy_item.ext: -------------------------------------------------------------------------------- 1 | dummy content -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestProjectGeneration/Solution_Items/subdir/dummy_item_1.txt: -------------------------------------------------------------------------------- 1 | dummy content -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestProjectGeneration/Solution_Items/subdir/dummy_item_2.xml: -------------------------------------------------------------------------------- 1 | dummy content -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestResources/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "windows.h" 3 | #include "resource.h" 4 | 5 | // WinMain 6 | //------------------------------------------------------------------------------ 7 | int __stdcall WinMain( HINSTANCE, HINSTANCE, LPSTR, int ) 8 | { 9 | // Show the dialog 10 | HINSTANCE hInst = (HINSTANCE)GetModuleHandle( nullptr ); 11 | if ( CreateDialog( hInst, MAKEINTRESOURCE( IDD_DIALOG1 ), nullptr, nullptr) ) 12 | { 13 | return 1; // everything is ok - test will check for this 14 | } 15 | 16 | return 0; // failed to find resource - test will fail 17 | } 18 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestResources/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by main.rc 4 | // 5 | #define IDD_DIALOG1 101 6 | #define ID_BUTTON_CONVERT 1000 7 | #define IDC_EDIT_SRC 1002 8 | #define IDC_EDIT_DST 1003 9 | #define IDC_CHECK_OVERRIDE_DST 1004 10 | #define IDC_BUTTON_CHOOSE_SRC 1005 11 | #define IDC_BUTTON_CHOOSE_DST 1006 12 | #define IDC_COMBO_TEXTURE_FORMAT2 1008 13 | #define IDC_COMBO_TEXTURE_FORMAT 1008 14 | #define IDC_RADIO4 1015 15 | #define IDC_RADIO_RGBA 1015 16 | #define IDC_RADIO5 1016 17 | #define IDC_RADIO_MASK 1016 18 | #define IDC_RADIO_MASKFILE 1017 19 | #define IDC_EDIT_SRC_ALPHA 1018 20 | 21 | // Next default values for new objects 22 | // 23 | #ifdef APSTUDIO_INVOKED 24 | #ifndef APSTUDIO_READONLY_SYMBOLS 25 | #define _APS_NEXT_RESOURCE_VALUE 103 26 | #define _APS_NEXT_COMMAND_VALUE 40001 27 | #define _APS_NEXT_CONTROL_VALUE 1019 28 | #define _APS_NEXT_SYMED_VALUE 101 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestResources/resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestResources/resource.rc -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestTest/Fail_Crash/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple executable to run as a test which crashes 3 | // 4 | 5 | #if defined( __WINDOWS__ ) 6 | #include "windows.h" // For SetErrorMode 7 | #endif 8 | 9 | int main(int, char **) 10 | { 11 | #if defined( __WINDOWS__ ) 12 | // Prevent crash popups on Windows 13 | SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX ); 14 | #endif 15 | 16 | int * i = nullptr; 17 | *i = 99; // nullptr deref crash 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestTest/Fail_ReturnCode/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple executable to run as a test which fails 3 | // 4 | 5 | int main(int, char **) 6 | { 7 | return 1; // non-zero return code to indicate failure 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestTest/test.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An simple executable to run as a test 3 | // 4 | 5 | int main(int, char **) 6 | { 7 | return 0; // test will check this 8 | } 9 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestTest/test_timeout.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // An test that fails to return 3 | // 4 | 5 | int main(int , char **) 6 | { 7 | for (;;) 8 | { 9 | // busy wait spin to avoid pulling dependencies for sleep/yield 10 | } 11 | #if defined( __GNUC__ ) 12 | // GCC 4.8 warns about function not returning if value is return is omitted. 13 | // MSVC warns about unreachable code is the return is present. 14 | return 0; 15 | #endif 16 | } 17 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/CacheUsingRelativePaths/File.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Subdir/Header.h" 3 | 4 | const char* Function() 5 | { 6 | // .obj file will contain filename, surrounded by these tokens 7 | return "FILE_MACRO_START_2(" __FILE__ ")FILE_MACRO_END_2"; 8 | } 9 | 10 | const char* Function2() 11 | { 12 | return GetFile(); // From included header 13 | } -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/CacheUsingRelativePaths/Subdir/Header.h: -------------------------------------------------------------------------------- 1 | 2 | inline const char* GetFile() 3 | { 4 | // .obj file will contain filename, surrounded by these tokens 5 | return "FILE_MACRO_START_1(" __FILE__ ")FILE_MACRO_END_1"; 6 | } -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/ClangStaticAnalysis/file.1.cpp: -------------------------------------------------------------------------------- 1 | 2 | int DivideByZeroFunction( int value ) 3 | { 4 | return ( value / 0 ); // Generates warning 5 | } 6 | 7 | void OutOfScopePointerToStack() 8 | { 9 | static int * x; 10 | int y; 11 | x = &y; // Generates warning 12 | } 13 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/Exclusions/ignore.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error This file should not be compiled 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/Exclusions/ok.cpp: -------------------------------------------------------------------------------- 1 | // simple valid file 2 | void Function() 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/IsolateListFile/IsolateFileList.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Tools/FBuild/FBuildTest/Data/TestUnity/IsolateListFile/file.1.cpp 4 | Tools/FBuild/FBuildTest/SomeFileThatDoesNotExist.cpp 5 | 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/IsolateListFile/file.1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/IsolateListFile/file.1.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/IsolateListFile/file.2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/IsolateListFile/file.2.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/PrecompiledHeader.cpp: -------------------------------------------------------------------------------- 1 | #include "PrecompiledHeader.h" 2 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/PrecompiledHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/PrecompiledHeader.h -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/UnityInputIsolatedFiles/file.1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/UnityInputIsolatedFiles/file.1.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/UnityInputIsolatedFiles/file.2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/UnityInputIsolatedFiles/file.2.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/a.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/a.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/b.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/b.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/c.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/c.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/d.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/d.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/e.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/e.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/f.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestUnity/f.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestUnity/wontcompile.cpp: -------------------------------------------------------------------------------- 1 | 2 | #error This file should be excluded from the Unity 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestWarnings/ClangMacroExpansion/clang_macro_expansion.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define MC_ASSERT(X) (X) 3 | 4 | int main() 5 | { 6 | // Clang will suppress the "-Wtautological-compare" because it comes from within a macro 7 | // However, preprocessing will strip the macro, causing inconsistent behaviour. 8 | // Using "-rewrite-includes" avoids macro expansion during preprocessing and keeps 9 | // the behaviour consistent 10 | 11 | unsigned int i = 0; 12 | bool result = MC_ASSERT(i >= 0); 13 | return result; 14 | } 15 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestWarnings/pragma_message.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define STRING2(x) #x 3 | #define STRING(x) STRING2(x) 4 | 5 | #define PRAGMA_OPTIMIZE_OFF __pragma(optimize("", off)) __pragma(message(__FILE__ "(" STRING(__LINE__) "): warning : Optimization force disabled")) 6 | 7 | PRAGMA_OPTIMIZE_OFF 8 | 9 | void Function() 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestWarnings/warnings.cpp: -------------------------------------------------------------------------------- 1 | 2 | void Function() 3 | { 4 | int i; // Generates warnings 5 | } 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Data/TestZW/Caching/file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildTest/Data/TestZW/Caching/file.cpp -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildTest/Tests/TestError.cpp: -------------------------------------------------------------------------------- 1 | // TestError.cpp 2 | //------------------------------------------------------------------------------ 3 | 4 | // Includes 5 | //------------------------------------------------------------------------------ 6 | #include "Tools/FBuild/FBuildTest/Tests/FBuildTest.h" 7 | 8 | // FBuildCore 9 | #include "Tools/FBuild/FBuildCore/BFF/BFFParser.h" 10 | #include "Tools/FBuild/FBuildCore/FBuild.h" 11 | #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" 12 | 13 | #include "Core/Containers/AutoPtr.h" 14 | #include "Core/FileIO/FileStream.h" 15 | 16 | // TestError 17 | //------------------------------------------------------------------------------ 18 | class TestError : public FBuildTest 19 | { 20 | private: 21 | DECLARE_TESTS 22 | 23 | void Error() const; 24 | }; 25 | 26 | // Register Tests 27 | //------------------------------------------------------------------------------ 28 | REGISTER_TESTS_BEGIN( TestError ) 29 | REGISTER_TEST( Error ) 30 | REGISTER_TESTS_END 31 | 32 | // Error 33 | //------------------------------------------------------------------------------ 34 | void TestError::Error() const 35 | { 36 | Parse( "Tools/FBuild/FBuildTest/Data/TestError/error.bff", true ); // true = Expect failure 37 | TEST_ASSERT( GetRecordedOutput().Find( "#1999 - Error() - User Error: String value is 'Value'" ) ); 38 | } 39 | 40 | //------------------------------------------------------------------------------ 41 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildWorker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME FBuildWorker) 2 | 3 | ucm_add_dirs( 4 | Worker 5 | TO SOURCES RECURSIVE) 6 | 7 | 8 | set(RESOURCE_FILES 9 | MainWindowResource.rc 10 | ) 11 | 12 | 13 | ucm_add_files( 14 | "FBuildWorkerOptions.cpp" 15 | "FBuildWorkerOptions.h" 16 | "Main.cpp" 17 | "resource.h" 18 | TO SOURCES) 19 | 20 | 21 | add_executable(${TARGET_NAME} ${SOURCES} ${RESOURCE_FILES}) 22 | 23 | target_link_libraries(${TARGET_NAME} PRIVATE Core FBuildCore lz4 OSUI 24 | Advapi32.lib 25 | kernel32.lib 26 | Ws2_32.lib 27 | User32.lib 28 | Shell32.lib 29 | Comctl32.lib 30 | Gdi32.lib 31 | psapi.lib 32 | ) 33 | 34 | 35 | set_target_properties(${TARGET_NAME} PROPERTIES 36 | RESOURCE ${RESOURCE_FILES} 37 | ) 38 | 39 | 40 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Apps") 41 | target_link_options(${TARGET_NAME} PRIVATE "/SUBSYSTEM:WINDOWS") 42 | install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_HOME_DIRECTORY}/bin) -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildWorker/MainWindowResource.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/FBuildWorker/MainWindowResource.aps -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildWorker/MainWindowResource.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | 3 | // ICONS 4 | IDI_MAIN_ICON ICON "..\\icons\\blue.ico" 5 | IDI_TRAY_ICON ICON "..\\icons\\tray.ico" 6 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/FBuildWorker/resource.h: -------------------------------------------------------------------------------- 1 | #define IDI_MAIN_ICON 101 2 | #define IDI_TRAY_ICON 102 3 | -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/128x128_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/128x128_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/128x128_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/128x128_grey.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/16x16_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/16x16_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/16x16_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/16x16_grey.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/24x24_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/24x24_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/24x24_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/24x24_grey.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/256x256_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/256x256_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/256x256_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/256x256_grey.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/32x32_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/32x32_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/32x32_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/32x32_grey.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/48x48_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/48x48_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/64x64_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/64x64_blue.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/64x64_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/64x64_grey.png -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/blue.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/blue.ico -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/favicon.ico -------------------------------------------------------------------------------- /Code/Tools/FBuild/Icons/tray.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quanwei1992/FASTBuild_UnrealEngine/29c49672f82173a903cb32f0e4656e2fd07ebef2/Code/Tools/FBuild/Icons/tray.ico -------------------------------------------------------------------------------- /External/LZ4/.gitignore: -------------------------------------------------------------------------------- 1 | # make install artefact 2 | liblz4.pc 3 | -------------------------------------------------------------------------------- /External/LZ4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME lz4) 2 | 3 | 4 | add_library(${TARGET_NAME} STATIC 5 | lz4.c 6 | lz4frame.c 7 | lz4hc.c 8 | xxhash.c) 9 | 10 | target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "External") -------------------------------------------------------------------------------- /External/LZ4/LICENSE: -------------------------------------------------------------------------------- 1 | LZ4 Library 2 | Copyright (c) 2011-2016, Yann Collet 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, this 12 | list of conditions and the following disclaimer in the documentation and/or 13 | other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /External/LZ4/liblz4-dll.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // DLL version information. 4 | 1 VERSIONINFO 5 | FILEVERSION @LIBVER_MAJOR@,@LIBVER_MINOR@,@LIBVER_PATCH@,0 6 | PRODUCTVERSION @LIBVER_MAJOR@,@LIBVER_MINOR@,@LIBVER_PATCH@,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | #ifdef _DEBUG 9 | FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE 10 | #else 11 | FILEFLAGS 0 12 | #endif 13 | FILEOS VOS_NT_WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE VFT2_UNKNOWN 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "040904B0" 20 | BEGIN 21 | VALUE "CompanyName", "Yann Collet" 22 | VALUE "FileDescription", "Extremely fast compression" 23 | VALUE "FileVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@LIBVER_PATCH@.0" 24 | VALUE "InternalName", "@LIBLZ4@" 25 | VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" 26 | VALUE "OriginalFilename", "@LIBLZ4@.dll" 27 | VALUE "ProductName", "LZ4" 28 | VALUE "ProductVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@LIBVER_PATCH@.0" 29 | END 30 | END 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x0409, 1200 34 | END 35 | END 36 | -------------------------------------------------------------------------------- /External/LZ4/liblz4.pc.in: -------------------------------------------------------------------------------- 1 | # LZ4 - Fast LZ compression algorithm 2 | # Copyright (C) 2011-2014, Yann Collet. 3 | # BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 4 | 5 | prefix=@PREFIX@ 6 | libdir=@LIBDIR@ 7 | includedir=@INCLUDEDIR@ 8 | 9 | Name: lz4 10 | Description: extremely fast lossless compression algorithm library 11 | URL: http://www.lz4.org/ 12 | Version: @VERSION@ 13 | Libs: -L@LIBDIR@ -llz4 14 | Cflags: -I@INCLUDEDIR@ 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 袁全伟 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FASTBuild_UnrealEngine 2 | 3 | 4 | # How to build 5 | 6 | ## Requirements 7 | - VS2019/VS2017 8 | - CMake 9 | 10 | 11 | ## Step 1 12 | Run build.bat 13 | 14 | ## Step 2 15 | Copy bin/FBuild.exe to \\Engine\Binaries\ThirdParty\FastBuild\FastBuild.exe // eg:D:\Program Files\Epic Games\UE_4.25\Engine\Binaries\ThirdParty\FastBuild 16 | 17 | ## Step 3 18 | Copy UnrealBuildTool\4.25 to \\Engine\Source\Programs\UnrealBuildTool 19 | 20 | ## Step 4 21 | open \Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj 22 | 23 | and build it. 24 | 25 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | cmake -S . -B .\build 2 | cmake --build .\build --config Release 3 | cmake --install .\build 4 | pause --------------------------------------------------------------------------------