diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 6b2ab675b..de5eac190 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -159,6 +159,14 @@ jobs: & $env:SHARPMAKE_EXE "/sources('CSharpVsix.sharpmake.cs')" & $env:COMPILE_BATCH projects\CSharpVsixSolution.vs2017.v4_7_2.sln "${{ matrix.configuration }}" "Any CPU" + - name: CustomBuildStep ${{ matrix.configuration }} + if: runner.os == 'Windows' + working-directory: 'samples/CustomBuildStep' + run: | + & $env:SHARPMAKE_EXE "/sources('CustomBuildStep.sharpmake.cs')" + & $env:COMPILE_BATCH projects\custombuildstepsolution_vs2017_win64.sln "${{ matrix.configuration }}" "x64" + projects\output\win64\${{ matrix.configuration }}\custombuildstep.exe + - name: CSharpWCF ${{ matrix.configuration }} if: runner.os == 'Windows' working-directory: 'samples/CSharpWCF' @@ -202,6 +210,16 @@ jobs: & $env:COMPILE_BATCH codebase\temp\solutions\HelloClangCl_win64_vs2019.sln "MSVC ${{ matrix.configuration }}" "FastBuild" codebase\temp\bin\win64_msvc_${{ matrix.configuration }}_fastbuild\exe_rx.exe + - name: HelloEvents + if: runner.os == 'Windows' + working-directory: 'samples/HelloEvents' + run: | + & $env:SHARPMAKE_EXE "/sources('HelloEvents.Main.sharpmake.cs')" + & $env:COMPILE_BATCH codebase\temp\solutions\HelloEvents_win64_vs2019.sln "${{ matrix.configuration }}" "win64" + codebase\temp\bin\win64_${{ matrix.configuration }}\exe\exe.exe + & $env:COMPILE_BATCH codebase\temp\solutions\HelloEvents_win64_vs2019.sln "${{ matrix.configuration }}_FastBuild" "win64" + codebase\temp\bin\win64_${{ matrix.configuration }}_fastbuild\exe\exe.exe + - name: HelloLinux ${{ matrix.configuration }} if: runner.os == 'Linux' working-directory: 'samples/HelloLinux' diff --git a/CompileSharpmake.bat b/CompileSharpmake.bat index d3e4eb046..a374b93d0 100644 --- a/CompileSharpmake.bat +++ b/CompileSharpmake.bat @@ -44,7 +44,7 @@ goto success :BuildSharpmake echo Compiling %~1 in "%~2|%~3"... -set MSBUILD_CMD=msbuild -clp:Summary -t:rebuild -restore "%~1" /nologo /verbosity:m /p:Configuration="%~2" /p:Platform="%~3" +set MSBUILD_CMD=msbuild -clp:Summary -t:rebuild -restore "%~1" /nologo /verbosity:m /p:Configuration="%~2" /p:Platform="%~3" /maxcpucount /p:CL_MPCount=%NUMBER_OF_PROCESSORS% echo %MSBUILD_CMD% %MSBUILD_CMD% set ERROR_CODE=%errorlevel% diff --git a/README.md b/README.md index 266919b9e..92f20b11d 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,7 @@ source code also comes with samples that you can study. Building Sharpmake is quite straightforward. Clone the repo on GitHub, run the "bootstrap" script (".bat" for Windows, ".sh" for Unix platforms), open the solution in Visual Studio and build the solution in *Release*. The binaries -will be found in the *Sharpmake.Application/bin/Release*. You can run the -*deploy_binaries.py* script to automatically fetch the binaries and copy them -in a *Binaries* folder. +will be found in the *tmp/bin/release* directory. ## More Platforms diff --git a/Sharpmake.Application/Properties/AssemblyInfo.cs b/Sharpmake.Application/Properties/AssemblyInfo.cs index 6bd265468..86788f24c 100644 --- a/Sharpmake.Application/Properties/AssemblyInfo.cs +++ b/Sharpmake.Application/Properties/AssemblyInfo.cs @@ -22,7 +22,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ubisoft")] [assembly: AssemblyProduct("Sharpmake.Application")] -[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017-2018")] +[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017-2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -43,4 +43,4 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.17.0.0")] +[assembly: AssemblyVersion("0.17.1.0")] diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/explicitlyorderedpostbuildtest_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/explicitlyorderedpostbuildtest_vs2019_win64.bff index 57a7dd65b..734f9c779 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/explicitlyorderedpostbuildtest_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/explicitlyorderedpostbuildtest_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'ExplicitlyOrderedPostBuildTest_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\explicitlyorderedpostbuildtest\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_NoBlob_vs2019_win64_ //================================================================================================================= Executable( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\explicitlyorderedpostbuildtest\' .Libraries = 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\explicitlyorderedpostbuildtest.exe' @@ -216,7 +216,7 @@ Alias( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_NoBlob_vs2019_win64_Libra //================================================================================================================= ObjectList( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\explicitlyorderedpostbuildtest\' .CompilerExtraOptions = '' @@ -293,7 +293,7 @@ ObjectList( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_NoBlob_vs2019_win6 //================================================================================================================= Executable( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\explicitlyorderedpostbuildtest\' .Libraries = 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\explicitlyorderedpostbuildtest.exe' @@ -411,7 +411,7 @@ Alias( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_NoBlob_vs2019_win64_Lib //================================================================================================================= ObjectList( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\explicitlyorderedpostbuildtest\' .CompilerExtraOptions = '' @@ -487,7 +487,7 @@ ObjectList( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_vs2019_win64_objects //================================================================================================================= Executable( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\explicitlyorderedpostbuildtest\' .Libraries = 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\explicitlyorderedpostbuildtest.exe' @@ -605,7 +605,7 @@ Alias( 'ExplicitlyOrderedPostBuildTest_Debug_FastBuild_vs2019_win64_LibraryDepen //================================================================================================================= ObjectList( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\explicitlyorderedpostbuildtest\' .CompilerExtraOptions = '' @@ -682,7 +682,7 @@ ObjectList( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_vs2019_win64_objec //================================================================================================================= Executable( 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\explicitlyorderedpostbuildtest\' .Libraries = 'ExplicitlyOrderedPostBuildTest_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\explicitlyorderedpostbuildtest.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest-globalsettings.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest-globalsettings.bff index 4e3cb8c21..b3dc1c87a 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest-globalsettings.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest-globalsettings.bff @@ -19,6 +19,7 @@ Settings "TEMP=$TEMP$", "USERPROFILE=$USERPROFILE$", "SystemRoot=C:\WINDOWS" + "PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64" } } @@ -91,18 +92,30 @@ Compiler( 'Compiler-x64-vs2019' ) .CompilerFamily = 'msvc' } +Compiler( 'RC.win64Config' ) +{ + .Executable = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe' + .CompilerFamily = 'custom' +} + .win64Config = [ .BinPath = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64' .LinkerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64' - .ResourceCompiler = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe' + .ResourceCompiler = 'RC.win64Config' .Compiler = 'Compiler-x64-vs2019' .Librarian = '$LinkerPath$\lib.exe' .Linker = '$LinkerPath$\link.exe' ] +Compiler( 'ML.win64ConfigMasm' ) +{ + .Executable = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\ml64.exe' + .CompilerFamily = 'custom' +} + .win64ConfigMasm = [ Using( .win64Config ) - .Compiler = '$BinPath$\ml64.exe' + .Compiler = 'ML.win64ConfigMasm' ] diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest_all.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest_all.bff index 6e4d1bfde..a081dcbfb 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest_all.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/fastbuildfunctionaltest_all.bff @@ -27,13 +27,6 @@ Alias( 'FastBuildFunctionalTest_All_Debug_FastBuild_NoBlob_vs2019_win64' ) } -//================================================================================================================= -Alias( 'FastBuildFunctionalTest_All_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDependency' ) -{ - .Targets = 'FastBuildFunctionalTest_All_Debug_FastBuild_NoBlob_vs2019_win64_Unknown' -} - - //================================================================================================================= Alias( 'FastBuildFunctionalTest_All_Release_FastBuild_NoBlob_vs2019_win64' ) { @@ -52,13 +45,6 @@ Alias( 'FastBuildFunctionalTest_All_Release_FastBuild_NoBlob_vs2019_win64' ) } -//================================================================================================================= -Alias( 'FastBuildFunctionalTest_All_Release_FastBuild_NoBlob_vs2019_win64_LibraryDependency' ) -{ - .Targets = 'FastBuildFunctionalTest_All_Release_FastBuild_NoBlob_vs2019_win64_Unknown' -} - - //================================================================================================================= Alias( 'FastBuildFunctionalTest_All_Debug_FastBuild_vs2019_win64' ) { @@ -77,13 +63,6 @@ Alias( 'FastBuildFunctionalTest_All_Debug_FastBuild_vs2019_win64' ) } -//================================================================================================================= -Alias( 'FastBuildFunctionalTest_All_Debug_FastBuild_vs2019_win64_LibraryDependency' ) -{ - .Targets = 'FastBuildFunctionalTest_All_Debug_FastBuild_vs2019_win64_Unknown' -} - - //================================================================================================================= Alias( 'FastBuildFunctionalTest_All_Release_FastBuild_vs2019_win64' ) { @@ -102,12 +81,5 @@ Alias( 'FastBuildFunctionalTest_All_Release_FastBuild_vs2019_win64' ) } -//================================================================================================================= -Alias( 'FastBuildFunctionalTest_All_Release_FastBuild_vs2019_win64_LibraryDependency' ) -{ - .Targets = 'FastBuildFunctionalTest_All_Release_FastBuild_vs2019_win64_Unknown' -} - - #endif // WIN64 //////////////////////////////////////////////////////////////////////////////// diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2019_win64.bff index 4e0fec248..ad2eda9e2 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'MixCppAndCExe_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -174,7 +174,7 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\mixcppandcexe\' .Libraries = { 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_0_objects', @@ -258,7 +258,7 @@ Alias( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -335,7 +335,7 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -412,7 +412,7 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\mixcppandcexe\' .Libraries = { 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_0_objects', @@ -496,7 +496,7 @@ Alias( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -572,7 +572,7 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -648,7 +648,7 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\mixcppandcexe\' .Libraries = { 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_0_objects', @@ -732,7 +732,7 @@ Alias( 'MixCppAndCExe_Debug_FastBuild_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Release_FastBuild_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -809,7 +809,7 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'MixCppAndCExe_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\mixcppandcexe\' .CompilerExtraOptions = '' @@ -886,7 +886,7 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'MixCppAndCExe_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\mixcppandcexe\' .Libraries = { 'MixCppAndCExe_Release_FastBuild_vs2019_win64_0_objects', diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2019_win64.bff index f84a28270..249083e44 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'PostBuildCopyDirTest_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'PostBuildCopyDirTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildcopydirtest\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'PostBuildCopyDirTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildCopyDirTest_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildcopydirtest\' .Libraries = 'PostBuildCopyDirTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\postbuildcopydirtest.exe' @@ -192,7 +192,7 @@ Alias( 'PostBuildCopyDirTest_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDependen //================================================================================================================= ObjectList( 'PostBuildCopyDirTest_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildcopydirtest\' .CompilerExtraOptions = '' @@ -269,7 +269,7 @@ ObjectList( 'PostBuildCopyDirTest_Release_FastBuild_NoBlob_vs2019_win64_objects' //================================================================================================================= Executable( 'PostBuildCopyDirTest_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildcopydirtest\' .Libraries = 'PostBuildCopyDirTest_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\postbuildcopydirtest.exe' @@ -363,7 +363,7 @@ Alias( 'PostBuildCopyDirTest_Release_FastBuild_NoBlob_vs2019_win64_LibraryDepend //================================================================================================================= ObjectList( 'PostBuildCopyDirTest_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildcopydirtest\' .CompilerExtraOptions = '' @@ -439,7 +439,7 @@ ObjectList( 'PostBuildCopyDirTest_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildCopyDirTest_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildcopydirtest\' .Libraries = 'PostBuildCopyDirTest_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\postbuildcopydirtest.exe' @@ -533,7 +533,7 @@ Alias( 'PostBuildCopyDirTest_Debug_FastBuild_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'PostBuildCopyDirTest_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildcopydirtest\' .CompilerExtraOptions = '' @@ -610,7 +610,7 @@ ObjectList( 'PostBuildCopyDirTest_Release_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildCopyDirTest_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildcopydirtest\' .Libraries = 'PostBuildCopyDirTest_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\postbuildcopydirtest.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2019_win64.bff index 5e3094c04..44673bd44 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'PostBuildCopySingleFileTest_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'PostBuildCopySingleFileTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildcopysinglefiletest\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'PostBuildCopySingleFileTest_Debug_FastBuild_NoBlob_vs2019_win64_obj //================================================================================================================= Executable( 'PostBuildCopySingleFileTest_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildcopysinglefiletest\' .Libraries = 'PostBuildCopySingleFileTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\postbuildcopysinglefiletest.exe' @@ -191,7 +191,7 @@ Alias( 'PostBuildCopySingleFileTest_Debug_FastBuild_NoBlob_vs2019_win64_LibraryD //================================================================================================================= ObjectList( 'PostBuildCopySingleFileTest_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildcopysinglefiletest\' .CompilerExtraOptions = '' @@ -268,7 +268,7 @@ ObjectList( 'PostBuildCopySingleFileTest_Release_FastBuild_NoBlob_vs2019_win64_o //================================================================================================================= Executable( 'PostBuildCopySingleFileTest_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildcopysinglefiletest\' .Libraries = 'PostBuildCopySingleFileTest_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\postbuildcopysinglefiletest.exe' @@ -361,7 +361,7 @@ Alias( 'PostBuildCopySingleFileTest_Release_FastBuild_NoBlob_vs2019_win64_Librar //================================================================================================================= ObjectList( 'PostBuildCopySingleFileTest_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildcopysinglefiletest\' .CompilerExtraOptions = '' @@ -437,7 +437,7 @@ ObjectList( 'PostBuildCopySingleFileTest_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildCopySingleFileTest_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildcopysinglefiletest\' .Libraries = 'PostBuildCopySingleFileTest_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\postbuildcopysinglefiletest.exe' @@ -530,7 +530,7 @@ Alias( 'PostBuildCopySingleFileTest_Debug_FastBuild_vs2019_win64_LibraryDependen //================================================================================================================= ObjectList( 'PostBuildCopySingleFileTest_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildcopysinglefiletest\' .CompilerExtraOptions = '' @@ -607,7 +607,7 @@ ObjectList( 'PostBuildCopySingleFileTest_Release_FastBuild_vs2019_win64_objects' //================================================================================================================= Executable( 'PostBuildCopySingleFileTest_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildcopysinglefiletest\' .Libraries = 'PostBuildCopySingleFileTest_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\postbuildcopysinglefiletest.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2019_win64.bff index 385ed1ad9..692cfecae 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'PostBuildExecuteTest_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'PostBuildExecuteTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildexecutetest\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'PostBuildExecuteTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildExecuteTest_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildexecutetest\' .Libraries = 'PostBuildExecuteTest_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\postbuildexecutetest.exe' @@ -192,7 +192,7 @@ Alias( 'PostBuildExecuteTest_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDependen //================================================================================================================= ObjectList( 'PostBuildExecuteTest_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildexecutetest\' .CompilerExtraOptions = '' @@ -269,7 +269,7 @@ ObjectList( 'PostBuildExecuteTest_Release_FastBuild_NoBlob_vs2019_win64_objects' //================================================================================================================= Executable( 'PostBuildExecuteTest_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildexecutetest\' .Libraries = 'PostBuildExecuteTest_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\postbuildexecutetest.exe' @@ -363,7 +363,7 @@ Alias( 'PostBuildExecuteTest_Release_FastBuild_NoBlob_vs2019_win64_LibraryDepend //================================================================================================================= ObjectList( 'PostBuildExecuteTest_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildexecutetest\' .CompilerExtraOptions = '' @@ -439,7 +439,7 @@ ObjectList( 'PostBuildExecuteTest_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildExecuteTest_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildexecutetest\' .Libraries = 'PostBuildExecuteTest_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\postbuildexecutetest.exe' @@ -533,7 +533,7 @@ Alias( 'PostBuildExecuteTest_Debug_FastBuild_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'PostBuildExecuteTest_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildexecutetest\' .CompilerExtraOptions = '' @@ -610,7 +610,7 @@ ObjectList( 'PostBuildExecuteTest_Release_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildExecuteTest_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildexecutetest\' .Libraries = 'PostBuildExecuteTest_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\postbuildexecutetest.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2019_win64.bff index 00edc28c7..5922b25c3 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'PostBuildTestExecution_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'PostBuildTestExecution_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildtestexecution\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'PostBuildTestExecution_Debug_FastBuild_NoBlob_vs2019_win64_objects' //================================================================================================================= Executable( 'PostBuildTestExecution_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\postbuildtestexecution\' .Libraries = 'PostBuildTestExecution_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\postbuildtestexecution.exe' @@ -192,7 +192,7 @@ Alias( 'PostBuildTestExecution_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDepend //================================================================================================================= ObjectList( 'PostBuildTestExecution_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildtestexecution\' .CompilerExtraOptions = '' @@ -269,7 +269,7 @@ ObjectList( 'PostBuildTestExecution_Release_FastBuild_NoBlob_vs2019_win64_object //================================================================================================================= Executable( 'PostBuildTestExecution_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\postbuildtestexecution\' .Libraries = 'PostBuildTestExecution_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\postbuildtestexecution.exe' @@ -363,7 +363,7 @@ Alias( 'PostBuildTestExecution_Release_FastBuild_NoBlob_vs2019_win64_LibraryDepe //================================================================================================================= ObjectList( 'PostBuildTestExecution_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildtestexecution\' .CompilerExtraOptions = '' @@ -439,7 +439,7 @@ ObjectList( 'PostBuildTestExecution_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildTestExecution_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\postbuildtestexecution\' .Libraries = 'PostBuildTestExecution_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\postbuildtestexecution.exe' @@ -533,7 +533,7 @@ Alias( 'PostBuildTestExecution_Debug_FastBuild_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'PostBuildTestExecution_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildtestexecution\' .CompilerExtraOptions = '' @@ -610,7 +610,7 @@ ObjectList( 'PostBuildTestExecution_Release_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'PostBuildTestExecution_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\postbuildtestexecution\' .Libraries = 'PostBuildTestExecution_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\postbuildtestexecution.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2019_win64.bff index 3c6abbd03..65eacded3 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2019_win64.bff @@ -22,7 +22,7 @@ Unity( 'RequirePreBuildStep_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'RequirePreBuildStep_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\requireprebuildstep\' .CompilerExtraOptions = '' @@ -101,7 +101,7 @@ ObjectList( 'RequirePreBuildStep_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'RequirePreBuildStep_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\requireprebuildstep\' .Libraries = 'RequirePreBuildStep_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\requireprebuildstep.exe' @@ -182,7 +182,7 @@ Alias( 'RequirePreBuildStep_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDependenc //================================================================================================================= ObjectList( 'RequirePreBuildStep_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\requireprebuildstep\' .CompilerExtraOptions = '' @@ -262,7 +262,7 @@ ObjectList( 'RequirePreBuildStep_Release_FastBuild_NoBlob_vs2019_win64_objects' //================================================================================================================= Executable( 'RequirePreBuildStep_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\requireprebuildstep\' .Libraries = 'RequirePreBuildStep_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\requireprebuildstep.exe' @@ -343,7 +343,7 @@ Alias( 'RequirePreBuildStep_Release_FastBuild_NoBlob_vs2019_win64_LibraryDepende //================================================================================================================= ObjectList( 'RequirePreBuildStep_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\requireprebuildstep\' .CompilerExtraOptions = '' @@ -422,7 +422,7 @@ ObjectList( 'RequirePreBuildStep_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'RequirePreBuildStep_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\requireprebuildstep\' .Libraries = 'RequirePreBuildStep_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\requireprebuildstep.exe' @@ -503,7 +503,7 @@ Alias( 'RequirePreBuildStep_Debug_FastBuild_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'RequirePreBuildStep_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\requireprebuildstep\' .CompilerExtraOptions = '' @@ -583,7 +583,7 @@ ObjectList( 'RequirePreBuildStep_Release_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'RequirePreBuildStep_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\requireprebuildstep\' .Libraries = 'RequirePreBuildStep_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\requireprebuildstep.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2019_win64.bff index 6b6a79a00..eb5d93200 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2019_win64.bff @@ -12,7 +12,7 @@ //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBNoBlobExclude_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobexclude\' .CompilerExtraOptions = '' @@ -101,7 +101,7 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobExclude_Debug_FastBuild_NoBlob_vs2019_wi //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBNoBlobExclude_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobexclude\' .Libraries = 'SpanMultipleSrcDirsFBNoBlobExclude_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobexclude.exe' @@ -182,7 +182,7 @@ Alias( 'SpanMultipleSrcDirsFBNoBlobExclude_Debug_FastBuild_NoBlob_vs2019_win64_L //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBNoBlobExclude_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobexclude\' .CompilerExtraOptions = '' @@ -272,7 +272,7 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobExclude_Release_FastBuild_NoBlob_vs2019_ //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBNoBlobExclude_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobexclude\' .Libraries = 'SpanMultipleSrcDirsFBNoBlobExclude_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobexclude.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2019_win64.bff index 8f0da1d2e..9b85c259f 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2019_win64.bff @@ -12,7 +12,7 @@ //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBNoBlobInclude_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobinclude\' .CompilerExtraOptions = '' @@ -98,7 +98,7 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobInclude_Debug_FastBuild_NoBlob_vs2019_wi //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBNoBlobInclude_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobinclude\' .Libraries = 'SpanMultipleSrcDirsFBNoBlobInclude_Debug_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobinclude.exe' @@ -179,7 +179,7 @@ Alias( 'SpanMultipleSrcDirsFBNoBlobInclude_Debug_FastBuild_NoBlob_vs2019_win64_L //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBNoBlobInclude_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobinclude\' .CompilerExtraOptions = '' @@ -266,7 +266,7 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobInclude_Release_FastBuild_NoBlob_vs2019_ //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBNoBlobInclude_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobinclude\' .Libraries = 'SpanMultipleSrcDirsFBNoBlobInclude_Release_FastBuild_NoBlob_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_noblob_vs2019\spanmultiplesrcdirsfbnoblobinclude.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2019_win64.bff index 01671df55..5bcec0754 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2019_win64.bff @@ -29,7 +29,7 @@ Unity( 'SpanMultipleSrcDirsFBUnityExclude_unity' ) //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBUnityExclude_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\spanmultiplesrcdirsfbunityexclude\' .CompilerExtraOptions = '' @@ -107,7 +107,7 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityExclude_Debug_FastBuild_vs2019_win64_obje //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBUnityExclude_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\spanmultiplesrcdirsfbunityexclude\' .Libraries = 'SpanMultipleSrcDirsFBUnityExclude_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\spanmultiplesrcdirsfbunityexclude.exe' @@ -188,7 +188,7 @@ Alias( 'SpanMultipleSrcDirsFBUnityExclude_Debug_FastBuild_vs2019_win64_LibraryDe //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBUnityExclude_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\spanmultiplesrcdirsfbunityexclude\' .CompilerExtraOptions = '' @@ -267,7 +267,7 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityExclude_Release_FastBuild_vs2019_win64_ob //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBUnityExclude_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\spanmultiplesrcdirsfbunityexclude\' .Libraries = 'SpanMultipleSrcDirsFBUnityExclude_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\spanmultiplesrcdirsfbunityexclude.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2019_win64.bff index 4a7208c92..2d5e274b0 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2019_win64.bff @@ -30,7 +30,7 @@ Unity( 'SpanMultipleSrcDirsFBUnityInclude_unity' ) //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBUnityInclude_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\spanmultiplesrcdirsfbunityinclude\' .CompilerExtraOptions = '' @@ -108,7 +108,7 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityInclude_Debug_FastBuild_vs2019_win64_obje //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBUnityInclude_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\spanmultiplesrcdirsfbunityinclude\' .Libraries = 'SpanMultipleSrcDirsFBUnityInclude_Debug_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\debug_fastbuild_vs2019\spanmultiplesrcdirsfbunityinclude.exe' @@ -189,7 +189,7 @@ Alias( 'SpanMultipleSrcDirsFBUnityInclude_Debug_FastBuild_vs2019_win64_LibraryDe //================================================================================================================= ObjectList( 'SpanMultipleSrcDirsFBUnityInclude_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\spanmultiplesrcdirsfbunityinclude\' .CompilerExtraOptions = '' @@ -268,7 +268,7 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityInclude_Release_FastBuild_vs2019_win64_ob //================================================================================================================= Executable( 'SpanMultipleSrcDirsFBUnityInclude_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\spanmultiplesrcdirsfbunityinclude\' .Libraries = 'SpanMultipleSrcDirsFBUnityInclude_Release_FastBuild_vs2019_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\release_fastbuild_vs2019\spanmultiplesrcdirsfbunityinclude.exe' diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2019_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2019_win64.bff index 9339e5943..907c1dacd 100644 --- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2019_win64.bff +++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2019_win64.bff @@ -24,7 +24,7 @@ Unity( 'UsePrecompExe_FastBuildUnitys_unity' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -116,7 +116,7 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -196,7 +196,7 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_noblob_vs2019\useprecompexe\' .Libraries = { 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_0_objects', @@ -280,7 +280,7 @@ Alias( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -373,7 +373,7 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -454,7 +454,7 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_objects' ) //================================================================================================================= Executable( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_noblob_vs2019\useprecompexe\' .Libraries = { 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_0_objects', @@ -538,7 +538,7 @@ Alias( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Debug_FastBuild_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -627,7 +627,7 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Debug_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -707,7 +707,7 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'UsePrecompExe_Debug_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\debug_fastbuild_vs2019\useprecompexe\' .Libraries = { 'UsePrecompExe_Debug_FastBuild_vs2019_win64_0_objects', @@ -791,7 +791,7 @@ Alias( 'UsePrecompExe_Debug_FastBuild_vs2019_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Release_FastBuild_vs2019_win64_0_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -881,7 +881,7 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_vs2019_win64_0_objects' ) //================================================================================================================= ObjectList( 'UsePrecompExe_Release_FastBuild_vs2019_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\useprecompexe\' .CompilerExtraOptions = '' @@ -962,7 +962,7 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_vs2019_win64_objects' ) //================================================================================================================= Executable( 'UsePrecompExe_Release_FastBuild_vs2019_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\build\release_fastbuild_vs2019\useprecompexe\' .Libraries = { 'UsePrecompExe_Release_FastBuild_vs2019_win64_0_objects', diff --git a/Sharpmake.Generators/FastBuild/Bff.Template.cs b/Sharpmake.Generators/FastBuild/Bff.Template.cs index 41bc7c5c9..abd22b945 100644 --- a/Sharpmake.Generators/FastBuild/Bff.Template.cs +++ b/Sharpmake.Generators/FastBuild/Bff.Template.cs @@ -111,6 +111,22 @@ public static class ConfigurationFile .UseRelativePaths_Experimental = [fastBuildCompilerUseRelativePaths] [fastBuildCompilerAdditionalSettings] } +"; + + internal static string ResourceCompilerSettings = @" +Compiler( '[fastBuildResourceCompilerName]' ) +{ + .Executable = '[fastBuildResourceCompiler]' + .CompilerFamily = 'custom' +} +"; + + internal static string MasmCompilerSettings = @" +Compiler( '[fastBuildMasmCompilerName]' ) +{ + .Executable = '[fastBuildMasmCompiler]' + .CompilerFamily = 'custom' +} "; public static string CompilerConfiguration = @" @@ -119,7 +135,7 @@ public static class ConfigurationFile Using( [fastBuildUsing] ) .BinPath = '[fastBuildBinPath]' .LinkerPath = '[fastBuildLinkerPath]' - .ResourceCompiler = '[fastBuildResourceCompiler]' + .ResourceCompiler = '[fastBuildResourceCompilerName]' .Compiler = '[fastBuildCompilerName]' .Librarian = '[fastBuildLibrarian]' .Linker = '[fastBuildLinker]' @@ -455,7 +471,6 @@ public static class ConfigurationFile { [fastBuildUsingPlatformConfig] .Intermediate = '[cmdLineOptions.IntermediateDirectory]\' - "; public static string EndSection = "}\n\n"; @@ -473,7 +488,7 @@ public static class ConfigurationFile //================================================================================================================= Alias( '[fastBuildOutputFileShortName]_LibraryDependency' ) { - .Targets = '[fastBuildOutputFileShortName]_[fastBuildOutputType]' + .Targets = [fastBuildTargetLibraryDependencies] } "; @@ -493,7 +508,7 @@ public static class ConfigurationFile //================================================================================================================= [fastBuildOutputType]( '[fastBuildOutputFileShortName]_[fastBuildOutputType]' ) { - [fastBuildUsingPlatformConfig] + [fastBuildUsingPlatformConfig] .Intermediate = '[cmdLineOptions.IntermediateDirectory]\' .Libraries = [fastBuildProjectDependencies] .PreBuildDependencies = [fastBuildBuildOnlyDependencies] @@ -508,7 +523,7 @@ public static class ConfigurationFile //================================================================================================================= ObjectList( '[fastBuildOutputFileShortName]_resources' ) { - [fastBuildUsingPlatformConfig] + [fastBuildUsingPlatformConfig] .Intermediate = '[cmdLineOptions.IntermediateDirectory]\' "; @@ -516,7 +531,7 @@ public static class ConfigurationFile //================================================================================================================= ObjectList( '[fastBuildOutputFileShortName]_embedded' ) { - [fastBuildUsingPlatformConfig] + [fastBuildUsingPlatformConfig] .Intermediate = '[cmdLineOptions.IntermediateDirectory]\' "; @@ -524,7 +539,7 @@ public static class ConfigurationFile //================================================================================================================= ObjectList( '[fastBuildOutputFileShortName]_objects' ) { - [fastBuildUsingPlatformConfig] + [fastBuildUsingPlatformConfig] .Intermediate = '[cmdLineOptions.IntermediateDirectory]\' "; diff --git a/Sharpmake.Generators/FastBuild/Bff.Util.cs b/Sharpmake.Generators/FastBuild/Bff.Util.cs index 8e8a65245..35b4d034d 100644 --- a/Sharpmake.Generators/FastBuild/Bff.Util.cs +++ b/Sharpmake.Generators/FastBuild/Bff.Util.cs @@ -678,7 +678,7 @@ public static string FBuildFormatList(List items, int spaceLength) return strBuilder.ToString(); } - internal static void WriteCustomBuildStepAsGenericExecutable(string projectRoot, FileGenerator bffGenerator, Project.Configuration.CustomFileBuildStep buildStep, Func functor) + internal static void WriteCustomBuildStepAsGenericExecutable(string projectRoot, FileGenerator bffGenerator, Project.Configuration.CustomFileBuildStep buildStep, Func functor) { var relativeBuildStep = buildStep.MakePathRelative(bffGenerator.Resolver, (path, commandRelative) => @@ -699,12 +699,14 @@ internal static void WriteCustomBuildStepAsGenericExecutable(string projectRoot, using (bffGenerator.Declare("fastBuildPrebuildWorkingPath", FileGeneratorUtilities.RemoveLineTag)) using (bffGenerator.Declare("fastBuildPrebuildUseStdOutAsOutput", FileGeneratorUtilities.RemoveLineTag)) using (bffGenerator.Declare("fastBuildPrebuildAlwaysShowOutput", FileGeneratorUtilities.RemoveLineTag)) + using (bffGenerator.Declare("fastBuildExecPreBuildDependencies", FileGeneratorUtilities.RemoveLineTag)) + using (bffGenerator.Declare("fastBuildExecAlways", FileGeneratorUtilities.RemoveLineTag)) { - functor(relativeBuildStep.Description); + functor(relativeBuildStep); } } - internal static void WriteConfigCustomBuildStepsAsGenericExecutable(string projectRoot, FileGenerator bffGenerator, Project project, Project.Configuration config, Func functor) + internal static void WriteConfigCustomBuildStepsAsGenericExecutable(string projectRoot, FileGenerator bffGenerator, Project project, Project.Configuration config, Func functor) { using (bffGenerator.Resolver.NewScopedParameter("project", project)) using (bffGenerator.Resolver.NewScopedParameter("config", config)) diff --git a/Sharpmake.Generators/FastBuild/Bff.cs b/Sharpmake.Generators/FastBuild/Bff.cs index 92acb1380..c7d066407 100644 --- a/Sharpmake.Generators/FastBuild/Bff.cs +++ b/Sharpmake.Generators/FastBuild/Bff.cs @@ -261,6 +261,7 @@ List skipFiles int configIndex = 0; var defaultTuple = GetDefaultTupleConfig(); + var allFileCustomBuild = new Dictionary(); var configurationsToBuild = confSourceFiles.Keys.OrderBy(x => x.Platform).ToList(); foreach (Project.Configuration conf in configurationsToBuild) @@ -509,6 +510,7 @@ List skipFiles Strings preBuildTargets = new Strings(); var fastBuildTargetSubTargets = new List(); + var fastBuildTargetLibraryDependencies = new List(); { if (isLastSubConfig) // post-build steps on the last subconfig { @@ -545,7 +547,9 @@ List skipFiles if (conf.Output == Project.Configuration.OutputType.Lib && useObjectLists) { - fastBuildTargetSubTargets.Add(fastBuildOutputFileShortName + "_objects"); + string objectList = fastBuildOutputFileShortName + "_objects"; + fastBuildTargetLibraryDependencies.Add(objectList); + fastBuildTargetSubTargets.Add(objectList); } else if (conf.Output == Project.Configuration.OutputType.None && project.IsFastBuildAll) { @@ -556,7 +560,9 @@ List skipFiles } else { - fastBuildTargetSubTargets.Add(fastBuildOutputFileShortName + "_" + outputType); + string targetId = fastBuildOutputFileShortName + "_" + outputType; + fastBuildTargetLibraryDependencies.Add(targetId); + fastBuildTargetSubTargets.Add(targetId); } if (isLastSubConfig) // post-build steps on the last subconfig @@ -608,6 +614,8 @@ List skipFiles if (!fastBuildTargetSubTargets.Contains(subTarget)) fastBuildTargetSubTargets.Add(subTarget); + if (!fastBuildTargetLibraryDependencies.Contains(subTarget)) + fastBuildTargetLibraryDependencies.Add(subTarget); } } } @@ -935,6 +943,30 @@ List skipFiles fastBuildEmbeddedResources = UtilityMethods.FBuildFormatList(fastbuildEmbeddedResourceFilesList, 30); } + var fileCustomBuildKeys = new Strings(); + UtilityMethods.WriteConfigCustomBuildStepsAsGenericExecutable(context.ProjectDirectoryCapitalized, bffGenerator, context.Project, conf, + key => + { + if (!allFileCustomBuild.TryGetValue(key.Description, out var alreadyRegistered)) + { + allFileCustomBuild.Add(key.Description, key); + bffGenerator.Write(Template.ConfigurationFile.GenericExecutableSection); + } + else if (key.Executable != alreadyRegistered.Executable || + key.KeyInput != alreadyRegistered.KeyInput || + key.Output != alreadyRegistered.Output || + key.ExecutableArguments != alreadyRegistered.ExecutableArguments) + { + throw new Exception(string.Format("Command key '{0}' duplicates another command. Command is:\n{1}", key, bffGenerator.Resolver.Resolve(Template.ConfigurationFile.GenericExecutableSection))); + } + + fileCustomBuildKeys.Add(key.Description); + + return false; + }); + + fastBuildBuildOnlyDependencies.AddRange(fileCustomBuildKeys); + Strings fastBuildPreBuildDependencies = new Strings(); var orderedForceUsingDeps = UtilityMethods.GetOrderedFlattenedProjectDependencies(conf, false, true); fastBuildPreBuildDependencies.AddRange(orderedForceUsingDeps.Select(dep => GetShortProjectName(dep.Project, dep))); @@ -1237,24 +1269,6 @@ List skipFiles bffGenerator.Write(Template.ConfigurationFile.EndSection); - var fileCustomBuildKeys = new Strings(); - UtilityMethods.WriteConfigCustomBuildStepsAsGenericExecutable(context.ProjectDirectoryCapitalized, bffGenerator, context.Project, conf, - key => - { - if (!fileCustomBuildKeys.Contains(key)) - { - fileCustomBuildKeys.Add(key); - bffGenerator.Write(Template.ConfigurationFile.GenericExecutableSection); - } - else - { - throw new Exception(string.Format("Command key '{0}' duplicates another command. Command is:\n{1}", key, bffGenerator.Resolver.Resolve(Template.ConfigurationFile.GenericExecutableSection))); - } - return false; - }); - - fastBuildProjectDependencies.AddRange(fileCustomBuildKeys); - // Resolve node name of the prebuild dependency for PostBuildEvents. string resolvedSectionNodeIdentifier; if (beginSectionType == Template.ConfigurationFile.ObjectListBeginSection) @@ -1282,6 +1296,7 @@ List skipFiles string genLibName = "'" + fastBuildOutputFileShortName + "_" + outputType + "'"; using (bffGenerator.Declare("fastBuildTargetSubTargets", mustGenerateLibrary ? genLibName : UtilityMethods.FBuildFormatList(fastBuildTargetSubTargets, 15))) using (bffGenerator.Declare("fastBuildOutputFileShortName", fastBuildOutputFileShortName)) + using (bffGenerator.Declare("fastBuildTargetLibraryDependencies", mustGenerateLibrary ? genLibName : UtilityMethods.FBuildFormatList(fastBuildTargetLibraryDependencies, 15))) { bffGenerator.Write(Template.ConfigurationFile.TargetSection); bffGenerator.Write(Template.ConfigurationFile.TargetForLibraryDependencySection); @@ -1295,10 +1310,11 @@ List skipFiles // Write Target Alias using (bffGenerator.Declare("fastBuildOutputFileShortName", fastBuildOutputFileShortName)) using (bffGenerator.Declare("fastBuildTargetSubTargets", UtilityMethods.FBuildFormatList(fastBuildTargetSubTargets, 15))) - using (bffGenerator.Declare("fastBuildOutputType", outputType)) + using (bffGenerator.Declare("fastBuildTargetLibraryDependencies", UtilityMethods.FBuildFormatList(fastBuildTargetLibraryDependencies, 15))) { bffGenerator.Write(Template.ConfigurationFile.TargetSection); - bffGenerator.Write(Template.ConfigurationFile.TargetForLibraryDependencySection); + if (!project.IsFastBuildAll) + bffGenerator.Write(Template.ConfigurationFile.TargetForLibraryDependencySection); } } break; diff --git a/Sharpmake.Generators/FastBuild/MasterBff.cs b/Sharpmake.Generators/FastBuild/MasterBff.cs index ae0fb4100..f87e495c8 100644 --- a/Sharpmake.Generators/FastBuild/MasterBff.cs +++ b/Sharpmake.Generators/FastBuild/MasterBff.cs @@ -247,6 +247,31 @@ private static void GenerateMasterBffFiles(Builder builder, IEnumerable outputsByBffAndNode + ) + { + string bffFullPath = Util.GetCapitalizedPath(conf.BffFullFileName) + FastBuildSettings.FastBuildConfigFileExtension; + + void registerOutputAndCheck(string outputFile) + { + if (!outputsByBffAndNode.TryGetValue(outputFile, out var pair)) + { + outputsByBffAndNode.Add(outputFile, (bffFullPath, fastBuildTargetIdentifier)); + } + else if (FileSystemStringComparer.StaticCompare(pair.sourceBff, bffFullPath) != 0 || pair.sourceNodeIdentifier != fastBuildTargetIdentifier) + { + throw new Error("Found identical output from multiple sources!"); + } + } + + + registerOutputAndCheck(conf.LinkerPdbFilePath); + registerOutputAndCheck(Path.Combine(conf.TargetPath, conf.TargetFileFullNameWithExtension)); + } + private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff configurationsPerBff) { configurationsPerBff.Sort(); @@ -275,7 +300,7 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff var bffPreBuildSection = new Dictionary(); var bffCustomPreBuildSection = new Dictionary(); - var bffMasterSection = new Dictionary(); + var bffCopyNodes = new Dictionary(); var masterBffCopySections = new List(); var masterBffCustomSections = new UniqueList(); // section that is not ordered @@ -284,6 +309,7 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff var platformBffCache = new Dictionary(); var verificationPostBuildCopies = new Dictionary(); + var outputsByBffAndNode = new Dictionary(FileSystemStringComparer.Default); foreach (Solution.Configuration solutionConfiguration in configurationsPerBff) { foreach (var solutionProject in solutionProjects) @@ -314,8 +340,10 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff platformBff.AddCompilerSettings(masterBffInfo.CompilerSettings, conf); + string fastBuildTargetIdentifier = Bff.GetShortProjectName(project, conf); + if (FastBuildSettings.WriteAllConfigsSection && includedProject.ToBuild == Solution.Configuration.IncludedProjectInfo.Build.Yes) - masterBffInfo.AllConfigsSections.Add(Bff.GetShortProjectName(project, conf)); + masterBffInfo.AllConfigsSections.Add(fastBuildTargetIdentifier); bool isOutputTypeExe = conf.Output == Project.Configuration.OutputType.Exe; bool isOutputTypeDll = conf.Output == Project.Configuration.OutputType.Dll; @@ -329,6 +357,8 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff var preBuildEvents = new Dictionary(); if (isOutputTypeExeOrDll || conf.ExecuteTargetCopy) { + RegisterBuiltOutputsForConf(conf, fastBuildTargetIdentifier, outputsByBffAndNode); + var copies = ProjectOptionsGenerator.ConvertPostBuildCopiesToRelative(conf, masterBffDirectory); foreach (var copy in copies) { @@ -340,12 +370,13 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff // use the global root for alias computation, as the project has not idea in which master bff it has been included var destinationRelativeToGlobal = Util.GetConvertedRelativePath(masterBffDirectory, destinationFolder, conf.Project.RootPath, true, conf.Project.RootPath); + string fastBuildCopyAlias = UtilityMethods.GetFastBuildCopyAlias(sourceFileName, destinationRelativeToGlobal); + string currentSourceFullPath = Util.PathGetAbsolute(masterBffDirectory, sourceFile); + if (FastBuildSettings.FastBuildValidateCopyFiles) { string key = sourceFileName + destinationRelativeToGlobal; - string currentSourceFullPath = Util.PathGetAbsolute(masterBffDirectory, sourceFile); - string previous; - if (verificationPostBuildCopies.TryGetValue(key, out previous)) + if (verificationPostBuildCopies.TryGetValue(key, out var previous)) { if (FileSystemStringComparer.StaticCompare(previous, currentSourceFullPath) != 0) builder.LogErrorLine("A post-build copy to the destination '{0}' already exist but from different sources: '{1}' and '{2}'!", Util.PathGetAbsolute(masterBffDirectory, destinationFolder), previous, currentSourceFullPath); @@ -356,17 +387,8 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff } } - string fastBuildCopyAlias = UtilityMethods.GetFastBuildCopyAlias(sourceFileName, destinationRelativeToGlobal); - { - using (fileGenerator.Declare("fastBuildCopyAlias", fastBuildCopyAlias)) - using (fileGenerator.Declare("fastBuildCopySource", Bff.CurrentBffPathKeyCombine(sourceFile))) - using (fileGenerator.Declare("fastBuildCopyDest", Bff.CurrentBffPathKeyCombine(destinationFile))) - using (fileGenerator.Declare("fastBuildCopyDependencies", FileGeneratorUtilities.RemoveLineTag)) - { - if (!bffMasterSection.ContainsKey(fastBuildCopyAlias)) - bffMasterSection.Add(fastBuildCopyAlias, fileGenerator.Resolver.Resolve(Bff.Template.ConfigurationFile.CopyFileSection)); - } - } + if (!bffCopyNodes.ContainsKey(fastBuildCopyAlias)) + bffCopyNodes.Add(fastBuildCopyAlias, (currentSourceFullPath, Bff.CurrentBffPathKeyCombine(sourceFile), Bff.CurrentBffPathKeyCombine(destinationFile))); } } @@ -404,23 +426,34 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff if (!mustGenerateFastbuild) throw new Error("Sharpmake-FastBuild : Trying to generate a MasterBff with none of its projects having a FastBuild configuration, or having a platform supporting it, or all of them having conf.DoNotGenerateFastBuild = true"); - masterBffCopySections.AddRange(bffMasterSection.Values); - masterBffCopySections.AddRange(bffPreBuildSection.Values); - - masterBffCustomSections.AddRange(bffCustomPreBuildSection.Values); - - var result = new StringBuilder(); - foreach (var projectBffFullPath in GetMasterIncludeList(masterBffInfo.BffIncludeToDependencyIncludes)) + var afterBffCopies = new Dictionary>(); + foreach (var copyNode in bffCopyNodes) { - string projectFullPath = Path.GetDirectoryName(projectBffFullPath); - var projectPathRelativeFromMasterBff = Util.PathGetRelative(masterBffDirectory, projectFullPath, true); - - string bffKeyRelative = Path.Combine(projectPathRelativeFromMasterBff, Path.GetFileName(projectBffFullPath)); + bool foundTargetInBff = outputsByBffAndNode.TryGetValue(copyNode.Value.sourceFullPath, out var bffAndNode); + using (fileGenerator.Declare("fastBuildCopyAlias", copyNode.Key)) + using (fileGenerator.Declare("fastBuildCopySource", copyNode.Value.src)) + using (fileGenerator.Declare("fastBuildCopyDest", copyNode.Value.dest)) + using (fileGenerator.Declare("fastBuildCopyDependencies", foundTargetInBff ? $"'{bffAndNode.sourceNodeIdentifier}'" : FileGeneratorUtilities.RemoveLineTag)) + { + string nodeContent = fileGenerator.Resolver.Resolve(Bff.Template.ConfigurationFile.CopyFileSection); - result.AppendLine($"#include \"{bffKeyRelative}\""); + if (!foundTargetInBff) + { + masterBffCopySections.Add(nodeContent); + } + else + { + if (!afterBffCopies.ContainsKey(bffAndNode.sourceBff)) + afterBffCopies.Add(bffAndNode.sourceBff, new List { nodeContent }); + else + afterBffCopies[bffAndNode.sourceBff].Add(nodeContent); + } + } } - string fastBuildMasterBffDependencies = result.Length == 0 ? FileGeneratorUtilities.RemoveLineTag : result.ToString(); + masterBffCopySections.AddRange(bffPreBuildSection.Values); + + masterBffCustomSections.AddRange(bffCustomPreBuildSection.Values); GenerateMasterBffGlobalSettingsFile(builder, globalConfigFullPath, masterBffInfo); @@ -439,6 +472,29 @@ private static bool GenerateMasterBffFile(Builder builder, ConfigurationsPerBff WriteMasterCopySection(fileGenerator, masterBffCopySections); WriteMasterCustomSection(fileGenerator, masterBffCustomSections); + var result = new StringBuilder(); + foreach (var projectBffFullPath in GetMasterIncludeList(masterBffInfo.BffIncludeToDependencyIncludes)) + { + string projectFullPath = Path.GetDirectoryName(projectBffFullPath); + var projectPathRelativeFromMasterBff = Util.PathGetRelative(masterBffDirectory, projectFullPath, true); + + string bffKeyRelative = Path.Combine(projectPathRelativeFromMasterBff, Path.GetFileName(projectBffFullPath)); + + result.AppendLine($"#include \"{bffKeyRelative}\""); + + if (afterBffCopies.TryGetValue(projectBffFullPath, out List copyNodes)) + { + foreach (var copyNode in copyNodes) + result.Append(copyNode); + afterBffCopies.Remove(projectBffFullPath); // not necessary but just to verify that we wrote all we wanted + } + } + + if (afterBffCopies.Count > 0) + throw new Error("The target source of some postbuild copies was not included in the master bff!"); + + string fastBuildMasterBffDependencies = result.Length == 0 ? FileGeneratorUtilities.RemoveLineTag : result.ToString(); + using (fileGenerator.Declare("fastBuildProjectName", masterBffFileName)) using (fileGenerator.Declare("fastBuildOrderedBffDependencies", fastBuildMasterBffDependencies)) { @@ -666,6 +722,9 @@ private static void WriteMasterCompilerSection(FileGenerator masterBffGenerator, using (masterBffGenerator.Declare("fastBuildBinPath", compConf.BinPath)) using (masterBffGenerator.Declare("fastBuildLinkerPath", compConf.LinkerPath)) using (masterBffGenerator.Declare("fastBuildResourceCompiler", compConf.ResourceCompiler)) + using (masterBffGenerator.Declare("fastBuildResourceCompilerName", compConf.ResourceCompiler != FileGeneratorUtilities.RemoveLineTag ? "RC" + compilerConfiguration.Key : FileGeneratorUtilities.RemoveLineTag)) + using (masterBffGenerator.Declare("fastBuildMasmCompiler", compConf.Masm)) + using (masterBffGenerator.Declare("fastBuildMasmCompilerName", "ML" + compilerConfiguration.Key)) using (masterBffGenerator.Declare("fastBuildCompilerName", compConf.Compiler != FileGeneratorUtilities.RemoveLineTag ? compConf.Compiler : compiler.Key)) using (masterBffGenerator.Declare("fastBuildLibrarian", compConf.Librarian)) using (masterBffGenerator.Declare("fastBuildLinker", compConf.Linker)) @@ -674,6 +733,12 @@ private static void WriteMasterCompilerSection(FileGenerator masterBffGenerator, using (masterBffGenerator.Declare("fastBuildExecutable", compConf.Executable)) using (masterBffGenerator.Declare("fastBuildUsing", compConf.UsingOtherConfiguration)) { + if (compConf.ResourceCompiler != FileGeneratorUtilities.RemoveLineTag) + masterBffGenerator.Write(Bff.Template.ConfigurationFile.ResourceCompilerSettings); + + if (!string.IsNullOrEmpty(compConf.Masm)) + masterBffGenerator.Write(Bff.Template.ConfigurationFile.MasmCompilerSettings); + masterBffGenerator.Write(Bff.Template.ConfigurationFile.CompilerConfiguration); } } diff --git a/Sharpmake.Generators/Properties/AssemblyInfo.cs b/Sharpmake.Generators/Properties/AssemblyInfo.cs index 2966ba971..1be7d119c 100644 --- a/Sharpmake.Generators/Properties/AssemblyInfo.cs +++ b/Sharpmake.Generators/Properties/AssemblyInfo.cs @@ -23,7 +23,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ubisoft")] [assembly: AssemblyProduct("Sharpmake.Generator")] -[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017")] +[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017-2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -44,6 +44,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.17.0.0")] +[assembly: AssemblyVersion("0.17.1.0")] [assembly: InternalsVisibleTo("Sharpmake")] diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs index 7a2ec63d3..60cbde30a 100644 --- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs +++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs @@ -23,7 +23,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ubisoft")] [assembly: AssemblyProduct("Sharpmake.CommonPlatforms")] -[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017")] +[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017-2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -44,6 +44,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.17.0.0")] +[assembly: AssemblyVersion("0.17.1.0")] [assembly: SharpmakeExtension] diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs index a7c1cb71f..03390723c 100644 --- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs +++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs @@ -92,6 +92,23 @@ public override void SetupSdkOptions(IGenerationContext context) context.Options["ExecutablePath"] = devEnv.GetWindowsExecutablePath(conf.Platform); } + Options.Vc.General.PlatformToolset platformToolset = Options.GetObject(conf); + if (Options.Vc.General.PlatformToolset.LLVM == platformToolset) + { + Options.Vc.General.PlatformToolset overridenPlatformToolset = Options.Vc.General.PlatformToolset.Default; + if (Options.WithArgOption.Get(conf, ref overridenPlatformToolset)) + platformToolset = overridenPlatformToolset; + + devEnv = platformToolset.GetDefaultDevEnvForToolset() ?? devEnv; + + context.Options["ExecutablePath"] = ClangForWindows.GetWindowsClangExecutablePath() + ";" + devEnv.GetWindowsExecutablePath(conf.Platform); + if (Options.GetObject(conf) == Options.Vc.LLVM.UseClangCl.Enable) + { + context.Options["IncludePath"] = ClangForWindows.GetWindowsClangIncludePath() + ";" + devEnv.GetWindowsIncludePath(); + context.Options["LibraryPath"] = ClangForWindows.GetWindowsClangLibraryPath() + ";" + devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment() : default(DotNetFramework?)); + } + } + var systemIncludes = new OrderableStrings(conf.DependenciesIncludeSystemPaths); systemIncludes.AddRange(conf.IncludeSystemPaths); if (systemIncludes.Count > 0) diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/Win64Platform.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/Win64Platform.cs index 206eab66d..20302ef5d 100644 --- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/Win64Platform.cs +++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/Win64Platform.cs @@ -328,11 +328,12 @@ private void SetConfiguration( if (!fastBuildCompilerSettings.ResCompiler.TryGetValue(devEnv, out resCompiler)) resCompiler = devEnv.GetWindowsResourceCompiler(Platform.win64); + string capitalizedBinPath = Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, binPath)); configurations.Add( configName, new CompilerSettings.Configuration( Platform.win64, - binPath: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, binPath)), + binPath: capitalizedBinPath, linkerPath: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, linkerPath)), resourceCompiler: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, resCompiler)), librarian: Path.Combine(@"$LinkerPath$", librarianExe), @@ -340,13 +341,17 @@ private void SetConfiguration( ) ); + string masmConfigurationName = configName + "Masm"; + var masmConfiguration = new CompilerSettings.Configuration( + Platform.win64, + compiler: "ML" + masmConfigurationName, + usingOtherConfiguration: configName + ); + masmConfiguration.Masm = Path.Combine(capitalizedBinPath, "ml64.exe"); + configurations.Add( - configName + "Masm", - new CompilerSettings.Configuration( - Platform.win64, - compiler: @"$BinPath$\ml64.exe", - usingOtherConfiguration: configName - ) + masmConfigurationName, + masmConfiguration ); } #endregion diff --git a/Sharpmake/FastBuildSettings.cs b/Sharpmake/FastBuildSettings.cs index 2c7c458a4..a06eee591 100644 --- a/Sharpmake/FastBuildSettings.cs +++ b/Sharpmake/FastBuildSettings.cs @@ -146,7 +146,7 @@ public enum CacheTypes /// be found in the same folder as link.exe, and if not add the path /// to one in the global settings Environment section, in the PATH variable /// - public static bool SetPathToResourceCompilerInEnvironment = false; + public static bool SetPathToResourceCompilerInEnvironment = true; /// /// This is used to activate a workaround in fastbuild for the VS2012 preprocessor enum bug. diff --git a/Sharpmake/Project.Configuration.cs b/Sharpmake/Project.Configuration.cs index d17febdfe..e906db1d1 100644 --- a/Sharpmake/Project.Configuration.cs +++ b/Sharpmake/Project.Configuration.cs @@ -202,7 +202,7 @@ public interface IConfigurationTasks /// /// Sets up the library paths when adding a dependency on a static library. /// - /// The instance on which to + /// The instance on which to /// set the paths. /// The bitflags /// that specify the properties of the dependency relationship. @@ -383,7 +383,7 @@ public enum DeoptimizationWritableFiles /// /// When the FASTBUILD_DEOPTIMIZE_OBJECT token is specified, - /// deoptimize files with writable status. + /// deoptimize files with writable status. /// /// /// This is useful when using Perforce, since files that have not been modified are @@ -458,7 +458,7 @@ public OutputType Output /// /// This setting is provided for libraries, because they are usually intermediate /// artifacts during the compilation process and do not need to be in the final output - /// directory unless it's necessary. + /// directory unless it's necessary. /// /// The default is false. Setting this to true will force the generators /// to copy the library artifacts. @@ -1858,7 +1858,7 @@ public class CustomFileBuildStepData /// on a different input file that also depends on the real input file. /// /// FASTBuild is key based, not file based. So it can have two different operations on the same file. - /// If you need support for FASTBuild, you can make two different custom build rules with one specific to BFF + /// If you need support for FASTBuild, you can make two different custom build rules with one specific to BFF /// and the other excluding BFF. /// /// @@ -1873,7 +1873,7 @@ public enum ProjectFilter /// ExcludeBFF, /// - /// The custom build step is specific to BFF + /// The custom build step is specific to BFF /// BFFOnly }; diff --git a/Sharpmake/Properties/AssemblyInfo.cs b/Sharpmake/Properties/AssemblyInfo.cs index 648887209..021e7eba9 100644 --- a/Sharpmake/Properties/AssemblyInfo.cs +++ b/Sharpmake/Properties/AssemblyInfo.cs @@ -23,7 +23,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ubisoft")] [assembly: AssemblyProduct("Sharpmake")] -[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017")] +[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2017-2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -44,9 +44,9 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.17.0.0")] +[assembly: AssemblyVersion("0.17.1.0")] #pragma warning disable CS7035 -[assembly: AssemblyFileVersion("0.17.0.0 (LocalBuild)")] +[assembly: AssemblyFileVersion("0.17.1.0 (LocalBuild)")] #pragma warning restore [assembly: InternalsVisibleTo("Sharpmake.Application")] diff --git a/samples/CustomBuildStep/CustomBuildStep.sharpmake.cs b/samples/CustomBuildStep/CustomBuildStep.sharpmake.cs new file mode 100644 index 000000000..c58e9a8e6 --- /dev/null +++ b/samples/CustomBuildStep/CustomBuildStep.sharpmake.cs @@ -0,0 +1,112 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Sharpmake; + +namespace FastBuild +{ + [Sharpmake.Generate] + public class CustomBuildStepProject : Project + { + public CustomBuildStepProject() + { + Name = "CustomBuildStep"; + SourceRootPath = @"[project.SharpmakeCsPath]\codebase"; + SourceFilesExtensions.Add(".bat"); + + // need to add it explicitly since it's gonna be generated it doesn't exist yet + SourceFiles.Add(@"[project.SourceRootPath]\main.cpp"); + + AddTargets( + new Target( + Platform.win64, + DevEnv.vs2017, + Optimization.Debug | Optimization.Release, + OutputType.Lib, + Blob.NoBlob, + BuildSystem.MSBuild | BuildSystem.FastBuild + ) + ); + } + + [Configure] + public void ConfigureAll(Configuration conf, Target target) + { + conf.CustomFileBuildSteps.Add( + new Configuration.CustomFileBuildStep + { + KeyInput = "filegeneration.bat", + Output = "main.cpp", + Description = $"Generate main.cpp", + Executable = "filegeneration.bat" + } + ); + + conf.ProjectFileName = "[project.Name]_[target.DevEnv]_[target.Platform]"; + conf.ProjectPath = @"[project.SharpmakeCsPath]\projects"; + } + + [Configure(BuildSystem.FastBuild)] + public void ConfigureFastBuild(Configuration conf, Target target) + { + conf.Name = "FastBuild " + conf.Name; + conf.IsFastBuild = true; + conf.FastBuildBlobbed = target.Blob == Blob.FastBuildUnitys; + } + } + + [Sharpmake.Generate] + public class CustomBuildStepSolution : Sharpmake.Solution + { + public CustomBuildStepSolution() + { + Name = "CustomBuildStepSolution"; + + AddTargets( + new Target( + Platform.win64, + DevEnv.vs2017, + Optimization.Debug | Optimization.Release, + OutputType.Lib, + Blob.NoBlob, + BuildSystem.MSBuild | BuildSystem.FastBuild + ) + ); + } + + [Configure()] + public void ConfigureAll(Configuration conf, Target target) + { + conf.SolutionFileName = "[solution.Name]_[target.DevEnv]_[target.Platform]"; + conf.SolutionPath = @"[solution.SharpmakeCsPath]\projects"; + + conf.AddProject(target); + } + + [Configure(BuildSystem.FastBuild)] + public void ConfigureFastBuild(Configuration conf, Target target) + { + conf.Name = "FastBuild " + conf.Name; + } + + [Sharpmake.Main] + public static void SharpmakeMain(Sharpmake.Arguments arguments) + { + FastBuildSettings.FastBuildMakeCommand = @"..\..\..\tools\FastBuild\Windows-x64\FBuild.exe"; + KitsRootPaths.SetUseKitsRootForDevEnv(DevEnv.vs2017, KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.v10_0_17763_0); + + arguments.Generate(); + } + } +} diff --git a/samples/CustomBuildStep/Properties/AssemblyInfo.cs b/samples/CustomBuildStep/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..8ba668c54 --- /dev/null +++ b/samples/CustomBuildStep/Properties/AssemblyInfo.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CustomBuildStep")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Ubisoft")] +[assembly: AssemblyProduct("CustomBuildStep")] +[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("de3e6399-3aec-4f3c-854d-b6311f3fdc92")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/CustomBuildStep/codebase/filegeneration.bat b/samples/CustomBuildStep/codebase/filegeneration.bat new file mode 100644 index 000000000..8b9a7558a --- /dev/null +++ b/samples/CustomBuildStep/codebase/filegeneration.bat @@ -0,0 +1,7 @@ +@echo off +SET FILENAME=%~dp0\main.cpp + +echo int main(int, char**) > %FILENAME% +echo { >> %FILENAME% +echo return 0; >> %FILENAME% +echo } >> %FILENAME% diff --git a/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsample_vs2019_win64-globalsettings.bff b/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsample_vs2019_win64-globalsettings.bff index 7ffcdd3b7..b3dc1c87a 100644 --- a/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsample_vs2019_win64-globalsettings.bff +++ b/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsample_vs2019_win64-globalsettings.bff @@ -92,18 +92,30 @@ Compiler( 'Compiler-x64-vs2019' ) .CompilerFamily = 'msvc' } +Compiler( 'RC.win64Config' ) +{ + .Executable = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe' + .CompilerFamily = 'custom' +} + .win64Config = [ .BinPath = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64' .LinkerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64' - .ResourceCompiler = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe' + .ResourceCompiler = 'RC.win64Config' .Compiler = 'Compiler-x64-vs2019' .Librarian = '$LinkerPath$\lib.exe' .Linker = '$LinkerPath$\link.exe' ] +Compiler( 'ML.win64ConfigMasm' ) +{ + .Executable = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\ml64.exe' + .CompilerFamily = 'custom' +} + .win64ConfigMasm = [ Using( .win64Config ) - .Compiler = '$BinPath$\ml64.exe' + .Compiler = 'ML.win64ConfigMasm' ] diff --git a/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2019_win64.bff b/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2019_win64.bff index ae5ec492e..f8f1e7434 100644 --- a/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2019_win64.bff +++ b/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2019_win64.bff @@ -12,7 +12,7 @@ //================================================================================================================= ObjectList( 'FastBuildSimpleExecutable_Debug_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\obj\win64\debug\' .CompilerExtraOptions = '' @@ -88,7 +88,7 @@ ObjectList( 'FastBuildSimpleExecutable_Debug_win64_objects' ) //================================================================================================================= Executable( 'FastBuildSimpleExecutable_Debug_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\obj\win64\debug\' .Libraries = 'FastBuildSimpleExecutable_Debug_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\win64\debug\fastbuildsimpleexecutable.exe' @@ -169,7 +169,7 @@ Alias( 'FastBuildSimpleExecutable_Debug_win64_LibraryDependency' ) //================================================================================================================= ObjectList( 'FastBuildSimpleExecutable_Release_win64_objects' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\obj\win64\release\' .CompilerExtraOptions = '' @@ -246,7 +246,7 @@ ObjectList( 'FastBuildSimpleExecutable_Release_win64_objects' ) //================================================================================================================= Executable( 'FastBuildSimpleExecutable_Release_win64_Executable' ) { - Using( .win64Config ) + Using( .win64Config ) .Intermediate = '.\$_CURRENT_BFF_DIR_$\obj\win64\release\' .Libraries = 'FastBuildSimpleExecutable_Release_win64_objects' .LinkerOutput = '.\$_CURRENT_BFF_DIR_$\output\win64\release\fastbuildsimpleexecutable.exe' diff --git a/samples/HelloClangCl/codebase/static lib2/static_lib2.sharpmake.cs b/samples/HelloClangCl/codebase/static lib2/static_lib2.sharpmake.cs index ea4f3433e..d17e89768 100644 --- a/samples/HelloClangCl/codebase/static lib2/static_lib2.sharpmake.cs +++ b/samples/HelloClangCl/codebase/static lib2/static_lib2.sharpmake.cs @@ -31,6 +31,9 @@ public override void ConfigureAll(Configuration conf, CommonTarget target) conf.SolutionFolder = "StaticLibs"; + // skip the generation of the lib, and use the obj for the link instead + conf.Options.Add(Options.Vc.Linker.UseLibraryDependencyInputs.Enable); + conf.IncludePaths.Add(SourceRootPath); } } diff --git a/samples/HelloEvents/HelloEvents.CommonProject.sharpmake.cs b/samples/HelloEvents/HelloEvents.CommonProject.sharpmake.cs new file mode 100644 index 000000000..75a89daa7 --- /dev/null +++ b/samples/HelloEvents/HelloEvents.CommonProject.sharpmake.cs @@ -0,0 +1,149 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.IO; +using System.Linq; +using Sharpmake; + +namespace HelloEvents +{ + public static class ConfigurePriorities + { + public const int All = -75; + public const int Platform = -50; + public const int Optimization = -25; + /* SHARPMAKE DEFAULT IS 0 */ + public const int Blobbing = 25; + public const int BuildSystem = 50; + } + + public abstract class CommonProject : Sharpmake.Project + { + protected CommonProject() + : base(typeof(CommonTarget)) + { + RootPath = Globals.RootDirectory; + IsFileNameToLower = false; + IsTargetFileNameToLower = false; + + SourceRootPath = @"[project.RootPath]\[project.Name]"; + } + + [ConfigurePriority(ConfigurePriorities.All)] + [Configure] + public virtual void ConfigureAll(Configuration conf, CommonTarget target) + { + conf.ProjectFileName = "[project.Name]_[target.Platform]"; + if (target.DevEnv != DevEnv.xcode4ios) + conf.ProjectFileName += "_[target.DevEnv]"; + conf.ProjectPath = Path.Combine(Globals.TmpDirectory, @"projects\[project.Name]"); + conf.IsFastBuild = target.BuildSystem == BuildSystem.FastBuild; + + conf.IntermediatePath = Path.Combine(Globals.TmpDirectory, @"obj\[target.DirectoryName]\[project.Name]"); + + // intentionally put all of the project outputs in their own directory + conf.TargetPath = Path.Combine(Globals.OutputDirectory, @"[target.DirectoryName]\[project.Name]"); + + conf.TargetLibraryPath = Path.Combine(Globals.TmpDirectory, @"lib\[target.DirectoryName]\[project.Name]"); + + conf.Output = Configuration.OutputType.Lib; // defaults to creating static libs + + conf.Options.Add(Options.Vc.Compiler.CppLanguageStandard.CPP17); + + conf.Options.Add(Options.Vc.General.TreatWarningsAsErrors.Enable); + + conf.Options.Add(Options.Vc.Linker.GenerateMapFile.Disable); + } + + //////////////////////////////////////////////////////////////////////// + #region Platfoms + [ConfigurePriority(ConfigurePriorities.Platform)] + [Configure(Platform.win64)] + public virtual void ConfigureWin64(Configuration conf, CommonTarget target) + { + conf.Defines.Add("_HAS_EXCEPTIONS=0"); + } + #endregion + //////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////// + #region Optimizations + [ConfigurePriority(ConfigurePriorities.Optimization)] + [Configure(Optimization.Debug)] + public virtual void ConfigureDebug(Configuration conf, CommonTarget target) + { + conf.DefaultOption = Options.DefaultTarget.Debug; + } + + [ConfigurePriority(ConfigurePriorities.Optimization)] + [Configure(Optimization.Release)] + public virtual void ConfigureRelease(Configuration conf, CommonTarget target) + { + conf.DefaultOption = Options.DefaultTarget.Release; + } + #endregion + //////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////// + #region Blobs and unitys + [Configure(Blob.FastBuildUnitys)] + [ConfigurePriority(ConfigurePriorities.Blobbing)] + public virtual void FastBuildUnitys(Configuration conf, CommonTarget target) + { + conf.FastBuildBlobbed = true; + conf.FastBuildUnityPath = Path.Combine(Globals.TmpDirectory, @"unity\[project.Name]"); + conf.IncludeBlobbedSourceFiles = false; + conf.IsBlobbed = false; + } + + [Configure(Blob.NoBlob)] + [ConfigurePriority(ConfigurePriorities.Blobbing)] + public virtual void BlobNoBlob(Configuration conf, CommonTarget target) + { + conf.FastBuildBlobbed = false; + conf.IsBlobbed = false; + + if (conf.IsFastBuild) + conf.ProjectName += "_NoBlob"; + } + #endregion + //////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////// + #region Build system + [ConfigurePriority(ConfigurePriorities.BuildSystem)] + [Configure(BuildSystem.MSBuild)] + public virtual void ConfigureMSBuild(Configuration conf, CommonTarget target) + { + // starting with vs2019 16.10, need this to fix warning: argument unused during compilation: '/MP' + conf.Options.Add(Options.Vc.Compiler.MultiProcessorCompilation.Disable); + } + + [ConfigurePriority(ConfigurePriorities.BuildSystem)] + [Configure(BuildSystem.FastBuild)] + public virtual void ConfigureFastBuild(Configuration conf, CommonTarget target) + { + conf.SolutionFolder = "FastBuild/" + conf.SolutionFolder; + conf.ProjectName += "_FastBuild"; + conf.ProjectFileName += "_FastBuild"; + + conf.Defines.Add("USES_FASTBUILD"); + + // Force writing to pdb from different cl.exe process to go through the pdb server + conf.AdditionalCompilerOptions.Add("/FS"); + } + #endregion + //////////////////////////////////////////////////////////////////////// + } +} diff --git a/samples/HelloEvents/HelloEvents.CommonSolution.sharpmake.cs b/samples/HelloEvents/HelloEvents.CommonSolution.sharpmake.cs new file mode 100644 index 000000000..b19b5ac87 --- /dev/null +++ b/samples/HelloEvents/HelloEvents.CommonSolution.sharpmake.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Sharpmake; + +namespace HelloEvents +{ + public class CommonSolution : Sharpmake.Solution + { + public CommonSolution() + : base(typeof(CommonTarget)) + { + IsFileNameToLower = false; + } + + [ConfigurePriority(ConfigurePriorities.All)] + [Configure] + public virtual void ConfigureAll(Configuration conf, CommonTarget target) + { + conf.SolutionFileName = "[solution.Name]_[target.Platform]"; + if (target.DevEnv != DevEnv.xcode4ios) + conf.SolutionFileName += "_[target.DevEnv]"; + if (target.BuildSystem == BuildSystem.FastBuild) + conf.Name += "_FastBuild"; + conf.PlatformName = "[target.SolutionPlatformName]"; + conf.SolutionPath = System.IO.Path.Combine(Globals.TmpDirectory, "solutions"); + } + } +} diff --git a/samples/HelloEvents/HelloEvents.CommonTarget.sharpmake.cs b/samples/HelloEvents/HelloEvents.CommonTarget.sharpmake.cs new file mode 100644 index 000000000..3a1ea074b --- /dev/null +++ b/samples/HelloEvents/HelloEvents.CommonTarget.sharpmake.cs @@ -0,0 +1,142 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Sharpmake; + +namespace HelloEvents +{ + [Fragment, Flags] + public enum Optimization + { + Debug = 1 << 0, + Release = 1 << 1 + } + + [DebuggerDisplay("\"{Platform}_{DevEnv}\" {Name}")] + public class CommonTarget : Sharpmake.ITarget + { + public Platform Platform; + public DevEnv DevEnv; + public Optimization Optimization; + public Blob Blob; + public BuildSystem BuildSystem; + + public CommonTarget() { } + + public CommonTarget( + Platform platform, + DevEnv devEnv, + Optimization optimization, + Blob blob, + BuildSystem buildSystem + ) + { + Platform = platform; + DevEnv = devEnv; + Optimization = optimization; + Blob = blob; + BuildSystem = buildSystem; + } + + public override string Name + { + get + { + var nameParts = new List + { + Optimization.ToString() + }; + return string.Join(" ", nameParts); + } + } + + public string SolutionPlatformName + { + get + { + var nameParts = new List(); + + nameParts.Add(Platform.ToString()); + + return string.Join("_", nameParts); + } + } + + /// + /// returns a string usable as a directory name, to use for instance for the intermediate path + /// + public string DirectoryName + { + get + { + var dirNameParts = new List(); + + dirNameParts.Add(Platform.ToString()); + dirNameParts.Add(Optimization.ToString()); + + if (BuildSystem == BuildSystem.FastBuild) + dirNameParts.Add(BuildSystem.ToString()); + + return string.Join("_", dirNameParts); + } + } + + public override Sharpmake.Optimization GetOptimization() + { + switch (Optimization) + { + case Optimization.Debug: + return Sharpmake.Optimization.Debug; + case Optimization.Release: + return Sharpmake.Optimization.Release; + default: + throw new NotSupportedException("Optimization value " + Optimization.ToString()); + } + } + + public override Platform GetPlatform() + { + return Platform; + } + + public static CommonTarget[] GetDefaultTargets() + { + var result = new List(); + result.AddRange(GetWin64Targets()); + return result.ToArray(); + } + + public static CommonTarget[] GetWin64Targets() + { + var defaultTarget = new CommonTarget( + Platform.win64, + DevEnv.vs2019, + Optimization.Debug | Optimization.Release, + Blob.NoBlob, + BuildSystem.MSBuild + ); + + // make a fastbuild version of the target + var fastBuildTarget = (CommonTarget)defaultTarget.Clone( + Blob.FastBuildUnitys, + BuildSystem.FastBuild + ); + + return new[] { defaultTarget, fastBuildTarget }; + } + } +} diff --git a/samples/HelloEvents/HelloEvents.Main.sharpmake.cs b/samples/HelloEvents/HelloEvents.Main.sharpmake.cs new file mode 100644 index 000000000..32a7ccf2d --- /dev/null +++ b/samples/HelloEvents/HelloEvents.Main.sharpmake.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using Sharpmake; +using Sharpmake.Generators.FastBuild; + +[module: Sharpmake.DebugProjectName("Sharpmake.HelloEvents")] + +[module: Sharpmake.Include("HelloEvents.*.sharpmake.cs")] +[module: Sharpmake.Include("codebase/*.sharpmake.cs")] +[module: Sharpmake.Include("codebase/*/*.sharpmake.cs")] + +namespace HelloEvents +{ + public static class Globals + { + // branch root path relative to current sharpmake file location + public const string RelativeRootPath = @".\codebase"; + public static string RootDirectory; + public static string TmpDirectory { get { return Path.Combine(RootDirectory, "temp"); } } + public static string OutputDirectory { get { return Path.Combine(TmpDirectory, "bin"); } } + } + + public static class Main + { + private static void ConfigureRootDirectory() + { + FileInfo fileInfo = Util.GetCurrentSharpmakeFileInfo(); + string rootDirectory = Path.Combine(fileInfo.DirectoryName, Globals.RelativeRootPath); + Globals.RootDirectory = Util.SimplifyPath(rootDirectory); + } + + private static void ConfigureAutoCleanup() + { + Util.FilesAutoCleanupActive = true; + Util.FilesAutoCleanupDBPath = Path.Combine(Globals.TmpDirectory, "sharpmake"); + + if (!Directory.Exists(Util.FilesAutoCleanupDBPath)) + Directory.CreateDirectory(Util.FilesAutoCleanupDBPath); + } + + [Sharpmake.Main] + public static void SharpmakeMain(Sharpmake.Arguments arguments) + { + ConfigureRootDirectory(); + ConfigureAutoCleanup(); + + FastBuildSettings.FastBuildWait = true; + FastBuildSettings.FastBuildSummary = false; + FastBuildSettings.FastBuildNoSummaryOnError = true; + FastBuildSettings.FastBuildDistribution = false; + FastBuildSettings.FastBuildMonitor = true; + FastBuildSettings.FastBuildAllowDBMigration = true; + FastBuildSettings.SetPathToResourceCompilerInEnvironment = true; + + KitsRootPaths.SetKitsRoot10ToHighestInstalledVersion(DevEnv.vs2019); + + // for the purpose of this sample, we'll reuse the FastBuild executables that live in the sharpmake source repo + string sharpmakeFastBuildDir = Util.PathGetAbsolute(Globals.RootDirectory, @"..\..\..\tools\FastBuild"); + switch (Util.GetExecutingPlatform()) + { + case Platform.linux: + FastBuildSettings.FastBuildMakeCommand = Path.Combine(sharpmakeFastBuildDir, "Linux-x64", "fbuild"); + break; + case Platform.mac: + FastBuildSettings.FastBuildMakeCommand = Path.Combine(sharpmakeFastBuildDir, "OSX-x64", "FBuild"); + break; + case Platform.win64: + default: + FastBuildSettings.FastBuildMakeCommand = Path.Combine(sharpmakeFastBuildDir, "Windows-x64", "FBuild.exe"); + break; + } + + Bff.UnityResolver = new Bff.FragmentUnityResolver(); + + foreach (Type solutionType in Assembly.GetExecutingAssembly().GetTypes().Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(CommonSolution)))) + arguments.Generate(solutionType); + } + } +} diff --git a/samples/HelloEvents/Properties/AssemblyInfo.cs b/samples/HelloEvents/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..26afde8d6 --- /dev/null +++ b/samples/HelloEvents/Properties/AssemblyInfo.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HelloEvents.Properties")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Ubisoft")] +[assembly: AssemblyProduct("HelloEvents.Properties")] +[assembly: AssemblyCopyright("Copyright \u00A9 Ubisoft 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("CC6018D5-0760-463E-92FB-849E7E904449")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/HelloEvents/codebase/HelloEvents.sharpmake.cs b/samples/HelloEvents/codebase/HelloEvents.sharpmake.cs new file mode 100644 index 000000000..a8dcaf1d9 --- /dev/null +++ b/samples/HelloEvents/codebase/HelloEvents.sharpmake.cs @@ -0,0 +1,38 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Sharpmake; + +namespace HelloEvents +{ + [Sharpmake.Generate] + public class HelloEventsSolution : CommonSolution + { + public HelloEventsSolution() + { + AddTargets(CommonTarget.GetDefaultTargets()); + Name = "HelloEvents"; + } + + public override void ConfigureAll(Configuration conf, CommonTarget target) + { + base.ConfigureAll(conf, target); + + conf.AddProject(target); + conf.AddProject(target); + conf.AddProject(target); + conf.AddProject(target); + } + } +} diff --git a/samples/HelloEvents/codebase/dll1/dll1.sharpmake.cs b/samples/HelloEvents/codebase/dll1/dll1.sharpmake.cs new file mode 100644 index 000000000..fc06f4e27 --- /dev/null +++ b/samples/HelloEvents/codebase/dll1/dll1.sharpmake.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; + +namespace HelloEvents +{ + [Sharpmake.Generate] + public class Dll1Project : CommonProject + { + public Dll1Project() + { + AddTargets(CommonTarget.GetDefaultTargets()); + Name = "dll1"; + } + + public override void ConfigureAll(Configuration conf, CommonTarget target) + { + base.ConfigureAll(conf, target); + + conf.SolutionFolder = "SharedLibs"; + + conf.PrecompHeader = "precomp.h"; + conf.PrecompSource = "precomp.cpp"; + + conf.Output = Configuration.OutputType.Dll; + + conf.Defines.Add("UTIL_DLL_EXPORT"); + conf.ExportDefines.Add("UTIL_DLL_IMPORT"); + + conf.IncludePaths.Add(SourceRootPath); + + conf.AddPrivateDependency(target); + } + } +} diff --git a/samples/HelloEvents/codebase/dll1/precomp.cpp b/samples/HelloEvents/codebase/dll1/precomp.cpp new file mode 100644 index 000000000..15c6d7b04 --- /dev/null +++ b/samples/HelloEvents/codebase/dll1/precomp.cpp @@ -0,0 +1,2 @@ +#include "precomp.h" + diff --git a/samples/HelloEvents/codebase/dll1/precomp.h b/samples/HelloEvents/codebase/dll1/precomp.h new file mode 100644 index 000000000..201c6bf40 --- /dev/null +++ b/samples/HelloEvents/codebase/dll1/precomp.h @@ -0,0 +1,7 @@ +#pragma once + +#pragma warning(push) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) diff --git a/samples/HelloEvents/codebase/dll1/util_dll.cpp b/samples/HelloEvents/codebase/dll1/util_dll.cpp new file mode 100644 index 000000000..4c30ce103 --- /dev/null +++ b/samples/HelloEvents/codebase/dll1/util_dll.cpp @@ -0,0 +1,39 @@ +#include "precomp.h" +#include "util_dll.h" + +#include "src/util_static_lib1.h" + +#pragma warning(push) +#pragma warning(disable: 4668) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) + +int UtilDll1::ComputeSum(const std::vector& someInts) +{ + int acc = 0; + for (int item : someInts) + acc += item; + +#if defined(_DEBUG) && _DEBUG + std::cout << "- Dll1 is built in Debug" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + +#if defined(NDEBUG) && NDEBUG + std::cout << "- Dll1 is built in Release" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + + acc += static_cast(static_lib1_utils::GetRandomPosition()); + + return acc; +} + diff --git a/samples/HelloEvents/codebase/dll1/util_dll.h b/samples/HelloEvents/codebase/dll1/util_dll.h new file mode 100644 index 000000000..ead7afc75 --- /dev/null +++ b/samples/HelloEvents/codebase/dll1/util_dll.h @@ -0,0 +1,21 @@ +#pragma once + +#pragma warning(push) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) + +#if defined(UTIL_DLL_EXPORT) && defined(_MSC_VER) +# define UTIL_DLL __declspec(dllexport) +#elif defined(UTIL_DLL_IMPORT) && defined(_MSC_VER) +# define UTIL_DLL __declspec(dllimport) +#else +# define UTIL_DLL +#endif + +struct UtilDll1 +{ + UTIL_DLL int ComputeSum(const std::vector& someInts); +}; + diff --git a/samples/HelloEvents/codebase/exe/exe.sharpmake.cs b/samples/HelloEvents/codebase/exe/exe.sharpmake.cs new file mode 100644 index 000000000..7364f8d78 --- /dev/null +++ b/samples/HelloEvents/codebase/exe/exe.sharpmake.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Sharpmake; + +namespace HelloEvents +{ + [Sharpmake.Generate] + public class ExeProject : CommonProject + { + public ExeProject() + { + AddTargets(CommonTarget.GetDefaultTargets()); + Name = "exe"; + } + + public override void ConfigureAll(Configuration conf, CommonTarget target) + { + base.ConfigureAll(conf, target); + + conf.Output = Configuration.OutputType.Exe; + + conf.PrecompHeader = "stdafx.h"; + conf.PrecompSource = "stdafx.cpp"; + + conf.AddPrivateDependency(target); + conf.AddPrivateDependency(target); + + conf.Defines.Add("CREATION_DATE=\"August 2021\""); + } + } +} diff --git a/samples/HelloEvents/codebase/exe/main.cpp b/samples/HelloEvents/codebase/exe/main.cpp new file mode 100644 index 000000000..fede67b6f --- /dev/null +++ b/samples/HelloEvents/codebase/exe/main.cpp @@ -0,0 +1,37 @@ +#include "stdafx.h" +#include "util_dll.h" +#include "util_static_lib2.h" +#include "sub folder/useless_static_lib2.h" + +int main(int, char**) +{ + std::cout << "Hello Events World, from " CREATION_DATE "!" << std::endl; + +#if defined(_DEBUG) && _DEBUG + std::cout << "- Exe is built in Debug" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + +#if defined(NDEBUG) && NDEBUG + std::cout << "- Exe is built in Release" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + + std::vector someArray(5, 6); + + // from dll1 + UtilDll1 utilityDll; + utilityDll.ComputeSum(someArray); + + // from static_lib2 + Util2 utilityStatic; + utilityStatic.DoSomethingUseful(); + StaticLib2::UselessMethod(); + return 0; +} diff --git a/samples/HelloEvents/codebase/exe/stdafx.cpp b/samples/HelloEvents/codebase/exe/stdafx.cpp new file mode 100644 index 000000000..fd4f341c7 --- /dev/null +++ b/samples/HelloEvents/codebase/exe/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/samples/HelloEvents/codebase/exe/stdafx.h b/samples/HelloEvents/codebase/exe/stdafx.h new file mode 100644 index 000000000..a53f0481b --- /dev/null +++ b/samples/HelloEvents/codebase/exe/stdafx.h @@ -0,0 +1,8 @@ +#pragma once + +#pragma warning(push) +#pragma warning(disable: 4668) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) diff --git a/samples/HelloEvents/codebase/static lib2/static_lib2.sharpmake.cs b/samples/HelloEvents/codebase/static lib2/static_lib2.sharpmake.cs new file mode 100644 index 000000000..177feeefc --- /dev/null +++ b/samples/HelloEvents/codebase/static lib2/static_lib2.sharpmake.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Sharpmake; + +namespace HelloEvents +{ + [Sharpmake.Generate] + public class StaticLib2Project : CommonProject + { + public StaticLib2Project() + { + AddTargets(CommonTarget.GetDefaultTargets()); + Name = "static lib2"; + } + + public override void ConfigureAll(Configuration conf, CommonTarget target) + { + base.ConfigureAll(conf, target); + + conf.SolutionFolder = "StaticLibs"; + + // skip the generation of the lib, and use the obj for the link instead + conf.Options.Add(Options.Vc.Linker.UseLibraryDependencyInputs.Enable); + + conf.IncludePaths.Add(SourceRootPath); + } + } +} diff --git a/samples/HelloEvents/codebase/static lib2/sub folder/useless_static_lib2.cpp b/samples/HelloEvents/codebase/static lib2/sub folder/useless_static_lib2.cpp new file mode 100644 index 000000000..5308d55d7 --- /dev/null +++ b/samples/HelloEvents/codebase/static lib2/sub folder/useless_static_lib2.cpp @@ -0,0 +1,17 @@ +#include "useless_static_lib2.h" + +#pragma warning(push) +#pragma warning(disable: 4668) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) + +namespace StaticLib2 +{ + void UselessMethod() + { + std::cout << "- Useless in fact!" << std::endl; + } +} + diff --git a/samples/HelloEvents/codebase/static lib2/sub folder/useless_static_lib2.h b/samples/HelloEvents/codebase/static lib2/sub folder/useless_static_lib2.h new file mode 100644 index 000000000..ee6d3ef92 --- /dev/null +++ b/samples/HelloEvents/codebase/static lib2/sub folder/useless_static_lib2.h @@ -0,0 +1,7 @@ +#pragma once + +namespace StaticLib2 +{ + void UselessMethod(); +} + diff --git a/samples/HelloEvents/codebase/static lib2/util_static_lib2.cpp b/samples/HelloEvents/codebase/static lib2/util_static_lib2.cpp new file mode 100644 index 000000000..7fe1753af --- /dev/null +++ b/samples/HelloEvents/codebase/static lib2/util_static_lib2.cpp @@ -0,0 +1,40 @@ +#include "util_static_lib2.h" + +#pragma warning(push) +#pragma warning(disable: 4668) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) + +Util2::Util2() = default; + +Util2::~Util2() +{ +} + +void Util2::DoSomethingUseful() const +{ +#if defined(_DEBUG) && _DEBUG + std::cout << "- StaticLib2 is built in Debug" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + +#if defined(NDEBUG) && NDEBUG + std::cout << "- StaticLib2 is built in Release" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + + return DoSomethingInternal("Yeah right..."); +} + +void Util2::DoSomethingInternal(const char* anArgument) const +{ + std::cout << "Useful, right?\n- " << anArgument << std::endl; +} diff --git a/samples/HelloEvents/codebase/static lib2/util_static_lib2.h b/samples/HelloEvents/codebase/static lib2/util_static_lib2.h new file mode 100644 index 000000000..196128c58 --- /dev/null +++ b/samples/HelloEvents/codebase/static lib2/util_static_lib2.h @@ -0,0 +1,15 @@ +#pragma once + +class Util2 +{ +public: + Util2(); + ~Util2(); + +public: + void DoSomethingUseful() const; + +private: + void DoSomethingInternal(const char* anArgument) const; +}; + diff --git a/samples/HelloEvents/codebase/static_lib1/src/ensure_debug.cpp b/samples/HelloEvents/codebase/static_lib1/src/ensure_debug.cpp new file mode 100644 index 000000000..a4c3dd5b6 --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/src/ensure_debug.cpp @@ -0,0 +1,11 @@ +#include "src/pch.h" + +#if !_DEBUG + #error Expected Debug define (_DEBUG) was not found +#endif + +#if defined(NDEBUG) && NDEBUG + #error Unexpected Release define (NDEBUG) was found +#endif + +#pragma message("Debug is built!") diff --git a/samples/HelloEvents/codebase/static_lib1/src/ensure_release.cpp b/samples/HelloEvents/codebase/static_lib1/src/ensure_release.cpp new file mode 100644 index 000000000..bf99db8c7 --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/src/ensure_release.cpp @@ -0,0 +1,11 @@ +#include "src/pch.h" + +#if defined(_DEBUG) && _DEBUG + #error Unexpected Debug define (_DEBUG) was found +#endif + +#if !NDEBUG + #error Expected Release define (NDEBUG) was not found +#endif + +#pragma message("Release is built!") diff --git a/samples/HelloEvents/codebase/static_lib1/src/pch.cpp b/samples/HelloEvents/codebase/static_lib1/src/pch.cpp new file mode 100644 index 000000000..e3cb5f78c --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/src/pch.cpp @@ -0,0 +1,2 @@ +#include "src/pch.h" + diff --git a/samples/HelloEvents/codebase/static_lib1/src/pch.h b/samples/HelloEvents/codebase/static_lib1/src/pch.h new file mode 100644 index 000000000..a53f0481b --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/src/pch.h @@ -0,0 +1,8 @@ +#pragma once + +#pragma warning(push) +#pragma warning(disable: 4668) +#pragma warning(disable: 4710) +#pragma warning(disable: 4711) +#include +#pragma warning(pop) diff --git a/samples/HelloEvents/codebase/static_lib1/src/util_static_lib1.cpp b/samples/HelloEvents/codebase/static_lib1/src/util_static_lib1.cpp new file mode 100644 index 000000000..9ec055461 --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/src/util_static_lib1.cpp @@ -0,0 +1,28 @@ +#include "src/pch.h" +#include "util_static_lib1.h" +#include + +namespace static_lib1_utils +{ + std::streampos GetRandomPosition() + { +#if defined(_DEBUG) && _DEBUG + std::cout << "- StaticLib1 is built in Debug" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + +#if defined(NDEBUG) && NDEBUG + std::cout << "- StaticLib1 is built in Release" +# if defined(USES_FASTBUILD) && USES_FASTBUILD + " with FastBuild" +# endif + "!" << std::endl; +#endif + + return 1; + } +} + diff --git a/samples/HelloEvents/codebase/static_lib1/src/util_static_lib1.h b/samples/HelloEvents/codebase/static_lib1/src/util_static_lib1.h new file mode 100644 index 000000000..0cec87480 --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/src/util_static_lib1.h @@ -0,0 +1,7 @@ +#pragma once +#include + +namespace static_lib1_utils +{ + std::streampos GetRandomPosition(); +} diff --git a/samples/HelloEvents/codebase/static_lib1/static_lib1.sharpmake.cs b/samples/HelloEvents/codebase/static_lib1/static_lib1.sharpmake.cs new file mode 100644 index 000000000..7cc5c1228 --- /dev/null +++ b/samples/HelloEvents/codebase/static_lib1/static_lib1.sharpmake.cs @@ -0,0 +1,54 @@ +// Copyright (c) 2021 Ubisoft Entertainment +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Sharpmake; + +namespace HelloEvents +{ + [Sharpmake.Generate] + public class StaticLib1Project : CommonProject + { + public StaticLib1Project() + { + AddTargets(CommonTarget.GetDefaultTargets()); + Name = "static_lib1"; + } + + public override void ConfigureAll(Configuration conf, CommonTarget target) + { + base.ConfigureAll(conf, target); + + conf.SolutionFolder = "StaticLibs"; + + // intentionally in a subfolder + conf.PrecompHeader = @"src\pch.h"; + conf.PrecompSource = @"src\pch.cpp"; + + conf.IncludePaths.Add(SourceRootPath); + + switch (target.Optimization) + { + case Optimization.Debug: + conf.SourceFilesBuildExclude.Add(@"src\ensure_release.cpp"); + break; + case Optimization.Release: + // use a different method to exclude ensure_debug.cpp + conf.SourceFilesBuildExcludeRegex.Add(Util.RegexPathCombine("src", @"ensure_d.*\.cpp$")); + break; + default: + throw new Error("Unexpected optimization " + target.Optimization); + } + } + } +} diff --git a/samples/Sharpmake.Samples.sharpmake.cs b/samples/Sharpmake.Samples.sharpmake.cs index b4bbfd59f..e015eaeb9 100644 --- a/samples/Sharpmake.Samples.sharpmake.cs +++ b/samples/Sharpmake.Samples.sharpmake.cs @@ -117,6 +117,15 @@ public CSharpWcfProject() } } + [Generate] + public class CustomBuildStepProject : SampleProject + { + public CustomBuildStepProject() + { + Name = "CustomBuildStep"; + } + } + [Generate] public class DotNetCoreFrameworkHelloWorldProject : SampleProject { @@ -178,6 +187,25 @@ public override void ConfigureAll(Configuration conf, Target target) } } + [Generate] + public class HelloEventsProject : SampleProject + { + public HelloEventsProject() + { + Name = "HelloEvents"; + SharpmakeMainFile = "HelloEvents.Main.sharpmake.cs"; + + // This one is special, we have .sharpmake.cs files in the codebase + SourceFilesExcludeRegex.Remove(@"\\codebase\\"); + } + + public override void ConfigureAll(Configuration conf, Target target) + { + base.ConfigureAll(conf, target); + conf.AddPrivateDependency(target); + } + } + [Generate] public class HelloLinuxProject : SampleProject {