diff --git a/Sharpmake.Application/Properties/AssemblyInfo.cs b/Sharpmake.Application/Properties/AssemblyInfo.cs
index e4a3c4074..d7f064cdd 100644
--- a/Sharpmake.Application/Properties/AssemblyInfo.cs
+++ b/Sharpmake.Application/Properties/AssemblyInfo.cs
@@ -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.14.1.0")]
+[assembly: AssemblyVersion("0.14.2.0")]
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/FastBuildFunctionalTest.sharpmake.cs b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/FastBuildFunctionalTest.sharpmake.cs
index 517b8f84f..1df71379f 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/FastBuildFunctionalTest.sharpmake.cs
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/FastBuildFunctionalTest.sharpmake.cs
@@ -302,6 +302,8 @@ public override void ConfigureAll(Configuration conf, Target target)
conf.PrecompSourceExclude.Add("noprecomp_util.cpp");
conf.PrecompSourceExcludeExtension.Add(".ceepeepee");
+
+ conf.Defines.Add("SOME_UTILITY_STRING=\"UTIL FUNC\"");
}
}
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/codebase/UsePrecompExe/util.cpp b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/codebase/UsePrecompExe/util.cpp
index 9669c393e..473a38f84 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/codebase/UsePrecompExe/util.cpp
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/codebase/UsePrecompExe/util.cpp
@@ -9,5 +9,5 @@
void Util::StaticUtilityMethod()
{
- printf("%s\n", __func__);
+ printf(SOME_UTILITY_STRING " => %s\n", __func__);
}
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2017_win64.bff
index bd3f59f85..0f1d311cd 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/mixcppandcexe_vs2017_win64.bff
@@ -42,9 +42,9 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -119,9 +119,9 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -273,9 +273,9 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -351,9 +351,9 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -506,9 +506,9 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -583,9 +583,9 @@ ObjectList( 'MixCppAndCExe_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -737,9 +737,9 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -815,9 +815,9 @@ ObjectList( 'MixCppAndCExe_Release_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2017_win64.bff
index f5620f729..59a686e81 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopydirtest_vs2017_win64.bff
@@ -42,9 +42,9 @@ ObjectList( 'PostBuildCopyDirTest_Debug_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -204,9 +204,9 @@ ObjectList( 'PostBuildCopyDirTest_Release_FastBuild_NoBlob_vs2017_win64_objects'
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -367,9 +367,9 @@ ObjectList( 'PostBuildCopyDirTest_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -529,9 +529,9 @@ ObjectList( 'PostBuildCopyDirTest_Release_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2017_win64.bff
index 8df7411a3..2f28bc48b 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildcopysinglefiletest_vs2017_win64.bff
@@ -42,9 +42,9 @@ ObjectList( 'PostBuildCopySingleFileTest_Debug_FastBuild_NoBlob_vs2017_win64_obj
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -204,9 +204,9 @@ ObjectList( 'PostBuildCopySingleFileTest_Release_FastBuild_NoBlob_vs2017_win64_o
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -367,9 +367,9 @@ ObjectList( 'PostBuildCopySingleFileTest_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -529,9 +529,9 @@ ObjectList( 'PostBuildCopySingleFileTest_Release_FastBuild_vs2017_win64_objects'
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2017_win64.bff
index e18965a93..3a8591512 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildexecutetest_vs2017_win64.bff
@@ -42,9 +42,9 @@ ObjectList( 'PostBuildExecuteTest_Debug_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -205,9 +205,9 @@ ObjectList( 'PostBuildExecuteTest_Release_FastBuild_NoBlob_vs2017_win64_objects'
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -369,9 +369,9 @@ ObjectList( 'PostBuildExecuteTest_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -532,9 +532,9 @@ ObjectList( 'PostBuildExecuteTest_Release_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2017_win64.bff
index ff8d5c296..c4e7eef83 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/postbuildtestexecution_vs2017_win64.bff
@@ -42,9 +42,9 @@ ObjectList( 'PostBuildTestExecution_Debug_FastBuild_NoBlob_vs2017_win64_objects'
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -205,9 +205,9 @@ ObjectList( 'PostBuildTestExecution_Release_FastBuild_NoBlob_vs2017_win64_object
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -369,9 +369,9 @@ ObjectList( 'PostBuildTestExecution_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -532,9 +532,9 @@ ObjectList( 'PostBuildTestExecution_Release_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2017_win64.bff
index 37d0c0188..deff157de 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/requireprebuildstep_vs2017_win64.bff
@@ -43,9 +43,9 @@ ObjectList( 'RequirePreBuildStep_Debug_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -197,9 +197,9 @@ ObjectList( 'RequirePreBuildStep_Release_FastBuild_NoBlob_vs2017_win64_objects'
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -352,9 +352,9 @@ ObjectList( 'RequirePreBuildStep_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -506,9 +506,9 @@ ObjectList( 'RequirePreBuildStep_Release_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2017_win64.bff
index 4f99c4d50..a601c230b 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobexclude_vs2017_win64.bff
@@ -34,9 +34,9 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobExclude_Debug_FastBuild_NoBlob_vs2017_wi
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -198,9 +198,9 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobExclude_Release_FastBuild_NoBlob_vs2017_
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2017_win64.bff
index 8cc207b96..9b453ecae 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbnoblobinclude_vs2017_win64.bff
@@ -34,9 +34,9 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobInclude_Debug_FastBuild_NoBlob_vs2017_wi
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -195,9 +195,9 @@ ObjectList( 'SpanMultipleSrcDirsFBNoBlobInclude_Release_FastBuild_NoBlob_vs2017_
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2017_win64.bff
index 76bddfe57..3c9af70ae 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityexclude_vs2017_win64.bff
@@ -51,9 +51,9 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityExclude_Debug_FastBuild_vs2017_win64_obje
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -204,9 +204,9 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityExclude_Release_FastBuild_vs2017_win64_ob
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2017_win64.bff
index f20aba08f..149353241 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/spanmultiplesrcdirsfbunityinclude_vs2017_win64.bff
@@ -52,9 +52,9 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityInclude_Debug_FastBuild_vs2017_win64_obje
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -205,9 +205,9 @@ ObjectList( 'SpanMultipleSrcDirsFBUnityInclude_Release_FastBuild_vs2017_win64_ob
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.bff b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.bff
index edc342728..0fe59278d 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.bff
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.bff
@@ -44,9 +44,10 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -136,9 +137,10 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -293,9 +295,10 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -386,9 +389,10 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_NoBlob_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -544,9 +548,10 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -633,9 +638,10 @@ ObjectList( 'UsePrecompExe_Debug_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -790,9 +796,10 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_vs2017_win64_0_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -880,9 +887,10 @@ ObjectList( 'UsePrecompExe_Release_FastBuild_vs2017_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
+ + ' "/DSOME_UTILITY_STRING=\"UTIL FUNC\""'
// Code Generation options
// ---------------------------
+ ' /GF'
diff --git a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.vcxproj b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.vcxproj
index 9f0e5b8bc..13f9b7fe0 100644
--- a/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.vcxproj
+++ b/Sharpmake.FunctionalTests/FastBuildFunctionalTest/reference/projects/useprecompexe_vs2017_win64.vcxproj
@@ -103,7 +103,7 @@ del "output\debug_fastbuild_noblob_vs2017\useprecompexe.ilk" >NUL 2>NUL
del "output\debug_fastbuild_noblob_vs2017\useprecompexe.lib" >NUL 2>NUL
del "output\debug_fastbuild_noblob_vs2017\useprecompexe.pdb" >NUL 2>NUL
output\debug_fastbuild_noblob_vs2017\useprecompexe.exe
- WIN64;_CONSOLE;_DEBUG
+ SOME_UTILITY_STRING="UTIL FUNC";WIN64;_CONSOLE;_DEBUG
useprecompexe.exe
@@ -124,7 +124,7 @@ del "output\debug_fastbuild_vs2017\useprecompexe.ilk" >NUL 2>NUL
del "output\debug_fastbuild_vs2017\useprecompexe.lib" >NUL 2>NUL
del "output\debug_fastbuild_vs2017\useprecompexe.pdb" >NUL 2>NUL
output\debug_fastbuild_vs2017\useprecompexe.exe
- WIN64;_CONSOLE;_DEBUG
+ SOME_UTILITY_STRING="UTIL FUNC";WIN64;_CONSOLE;_DEBUG
useprecompexe.exe
@@ -156,7 +156,7 @@ del "output\release_fastbuild_noblob_vs2017\useprecompexe.ilk" >NUL 2>NUL
del "output\release_fastbuild_noblob_vs2017\useprecompexe.lib" >NUL 2>NUL
del "output\release_fastbuild_noblob_vs2017\useprecompexe.pdb" >NUL 2>NUL
output\release_fastbuild_noblob_vs2017\useprecompexe.exe
- NDEBUG;WIN64;_CONSOLE
+ NDEBUG;SOME_UTILITY_STRING="UTIL FUNC";WIN64;_CONSOLE
useprecompexe.exe
@@ -177,7 +177,7 @@ del "output\release_fastbuild_vs2017\useprecompexe.ilk" >NUL 2>NUL
del "output\release_fastbuild_vs2017\useprecompexe.lib" >NUL 2>NUL
del "output\release_fastbuild_vs2017\useprecompexe.pdb" >NUL 2>NUL
output\release_fastbuild_vs2017\useprecompexe.exe
- NDEBUG;WIN64;_CONSOLE
+ NDEBUG;SOME_UTILITY_STRING="UTIL FUNC";WIN64;_CONSOLE
useprecompexe.exe
@@ -196,7 +196,7 @@ del "output\release_fastbuild_vs2017\useprecompexe.pdb" >NUL 2>NULUse
Level4
Disabled
- WIN64;_CONSOLE;_DEBUG;%(PreprocessorDefinitions);$(PreprocessorDefinitions)
+ SOME_UTILITY_STRING="UTIL FUNC";WIN64;_CONSOLE;_DEBUG;%(PreprocessorDefinitions);$(PreprocessorDefinitions)
ProgramDatabase
true
false
@@ -281,7 +281,7 @@ del "output\release_fastbuild_vs2017\useprecompexe.pdb" >NUL 2>NULUse
Level4
Full
- NDEBUG;WIN64;_CONSOLE;%(PreprocessorDefinitions);$(PreprocessorDefinitions)
+ NDEBUG;SOME_UTILITY_STRING="UTIL FUNC";WIN64;_CONSOLE;%(PreprocessorDefinitions);$(PreprocessorDefinitions)
ProgramDatabase
true
false
diff --git a/Sharpmake.Generators/Apple/XCodeProj.Template.cs b/Sharpmake.Generators/Apple/XCodeProj.Template.cs
index d0c94d947..96e9c3c01 100644
--- a/Sharpmake.Generators/Apple/XCodeProj.Template.cs
+++ b/Sharpmake.Generators/Apple/XCodeProj.Template.cs
@@ -339,37 +339,37 @@ private static class Template
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = [item.Options.AlwaysSearchUserPaths];
ARCHS = [item.Options.Archs];
- ASSETCATALOG_COMPILER_APPICON_NAME = [item.Options.AssetCatalogCompilerAppIconName];
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = [item.Options.ClangAnalyzerLocalizabilityNonlocalized];
+ ASSETCATALOG_COMPILER_APPICON_NAME = [item.Options.AssetCatalogCompilerAppIconName];
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = [item.Options.ClangAnalyzerLocalizabilityNonlocalized];
CLANG_CXX_LANGUAGE_STANDARD = ""[item.Options.CppStandard]"";
CLANG_CXX_LIBRARY = ""[item.Options.LibraryStandard]"";
CLANG_ENABLE_OBJC_ARC = [item.Options.AutomaticReferenceCounting];
- CLANG_ENABLE_OBJC_WEAK = [item.Options.ObjCWeakReferences];
- CLANG_ENABLE_MODULES = [item.Options.ClangEnableModules];
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = [item.Options.WarningBlockCaptureAutoReleasing];
+ CLANG_ENABLE_OBJC_WEAK = [item.Options.ObjCWeakReferences];
+ CLANG_ENABLE_MODULES = [item.Options.ClangEnableModules];
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = [item.Options.WarningBlockCaptureAutoReleasing];
CLANG_WARN_BOOL_CONVERSION = [item.Options.WarningBooleanConversion];
- CLANG_WARN_COMMA = [item.Options.WarningComma];
+ CLANG_WARN_COMMA = [item.Options.WarningComma];
CLANG_WARN_CONSTANT_CONVERSION = [item.Options.WarningConstantConversion];
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = [item.Options.WarningDeprecatedObjCImplementations];
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = [item.Options.WarningDeprecatedObjCImplementations];
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = [item.Options.WarningDirectIsaUsage];
CLANG_WARN_EMPTY_BODY = [item.Options.WarningEmptyBody];
CLANG_WARN_ENUM_CONVERSION = [item.Options.WarningEnumConversion];
- CLANG_WARN_INFINITE_RECURSION = [item.Options.WarningInfiniteRecursion];
+ CLANG_WARN_INFINITE_RECURSION = [item.Options.WarningInfiniteRecursion];
CLANG_WARN_INT_CONVERSION = [item.Options.WarningIntConversion];
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = [item.Options.WarningNonLiteralNullConversion];
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = [item.Options.WarningObjCImplicitRetainSelf];
- CLANG_WARN_OBJC_LITERAL_CONVERSION = [item.Options.WarningObjCLiteralConversion];
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = [item.Options.WarningNonLiteralNullConversion];
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = [item.Options.WarningObjCImplicitRetainSelf];
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = [item.Options.WarningObjCLiteralConversion];
CLANG_WARN_OBJC_ROOT_CLASS = [item.Options.WarningRootClass];
CLANG_WARN__DUPLICATE_METHOD_MATCH = [item.Options.WarningDuplicateMethodMatch];
- CLANG_WARN_RANGE_LOOP_ANALYSIS = [item.Options.WarningRangeLoopAnalysis];
- CLANG_WARN_STRICT_PROTOTYPES = [item.Options.WarningStrictPrototypes];
- CLANG_WARN_SUSPICIOUS_MOVE = [item.Options.WarningSuspiciousMove];
- CLANG_WARN_UNREACHABLE_CODE = [item.Options.WarningUnreachableCode];
- ENABLE_STRICT_OBJC_MSGSEND = [item.Options.StrictObjCMsgSend];
- ENABLE_TESTABILITY = [item.Options.Testability];
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = [item.Options.WarningRangeLoopAnalysis];
+ CLANG_WARN_STRICT_PROTOTYPES = [item.Options.WarningStrictPrototypes];
+ CLANG_WARN_SUSPICIOUS_MOVE = [item.Options.WarningSuspiciousMove];
+ CLANG_WARN_UNREACHABLE_CODE = [item.Options.WarningUnreachableCode];
+ ENABLE_STRICT_OBJC_MSGSEND = [item.Options.StrictObjCMsgSend];
+ ENABLE_TESTABILITY = [item.Options.Testability];
EXECUTABLE_PREFIX = [item.Options.ExecutablePrefix];
GCC_C_LANGUAGE_STANDARD = ""[item.Options.CStandard]"";
- GCC_NO_COMMON_BLOCKS = [item.Options.GccNoCommonBlocks];
+ GCC_NO_COMMON_BLOCKS = [item.Options.GccNoCommonBlocks];
GCC_PRECOMPILE_PREFIX_HEADER = [item.Options.UsePrecompiledHeader];
GCC_PREFIX_HEADER = ""[item.Options.PrecompiledHeader]"";
GCC_OPTIMIZATION_LEVEL = [item.Options.OptimizationLevel];
@@ -383,7 +383,7 @@ private static class Template
GCC_TREAT_WARNINGS_AS_ERRORS = [item.Options.TreatWarningsAsErrors];
SDKROOT = ""[item.Options.SDKRoot]"";
TARGETED_DEVICE_FAMILY = ""[item.Options.TargetedDeviceFamily]"";
- ONLY_ACTIVE_ARCH = [item.Options.OnlyActiveArch];
+ ONLY_ACTIVE_ARCH = [item.Options.OnlyActiveArch];
OTHER_CPLUSPLUSFLAGS = [item.Options.CompilerOptions];
OTHER_LDFLAGS = [item.Options.LinkerOptions];
};
diff --git a/Sharpmake.Generators/FastBuild/Bff.cs b/Sharpmake.Generators/FastBuild/Bff.cs
index 61cc5c250..af35840b5 100644
--- a/Sharpmake.Generators/FastBuild/Bff.cs
+++ b/Sharpmake.Generators/FastBuild/Bff.cs
@@ -25,7 +25,7 @@ namespace Sharpmake.Generators.FastBuild
{
public partial class Bff : IProjectGenerator
{
- private class BffGenerationContext : IGenerationContext
+ private class BffGenerationContext : IBffGenerationContext
{
private Resolver _envVarResolver;
@@ -35,6 +35,8 @@ private class BffGenerationContext : IGenerationContext
public Project.Configuration Configuration { get; set; }
+ public IReadOnlyList ProjectConfigurations { get; }
+
public string ProjectDirectory { get; }
public Options.ExplicitOptions Options { get; set; } = new Options.ExplicitOptions();
@@ -62,13 +64,17 @@ public Resolver EnvironmentVariableResolver
}
}
- public BffGenerationContext(Builder builder, Project project, string projectDir)
+ public IReadOnlyDictionary PresentPlatforms { get; }
+
+ public BffGenerationContext(Builder builder, Project project, string projectDir, IEnumerable projectConfigurations)
{
Builder = builder;
Project = project;
ProjectDirectory = projectDir;
ProjectDirectoryCapitalized = Util.GetCapitalizedPath(projectDir);
ProjectSourceCapitalized = Util.GetCapitalizedPath(project.SourceRootPath);
+ ProjectConfigurations = projectConfigurations as IReadOnlyList;
+ PresentPlatforms = ProjectConfigurations.Select(conf => conf.Platform).Distinct().ToDictionary(p => p, PlatformRegistry.Get);
}
public void SelectOption(params Options.OptionAction[] options)
@@ -196,7 +202,7 @@ List skipFiles
Project.Configuration firstConf = configurations.First();
string projectName = firstConf.ProjectName;
string projectPath = new FileInfo(projectFile).Directory.FullName;
- var context = new BffGenerationContext(builder, project, projectPath);
+ var context = new BffGenerationContext(builder, project, projectPath, configurations);
string projectBffFile = Bff.GetBffFileName(projectPath, firstConf.BffFileName); // TODO: bff file name could be different per conf, hence we would generate more than one file
string fastBuildClrSupport = Util.IsDotNet(firstConf) ? "/clr" : FileGeneratorUtilities.RemoveLineTag;
List filesInNonDefaultSection;
@@ -1344,6 +1350,8 @@ private static void GenerateBffOptions(
targetPlatformVersionString = GetLatestTargetPlatformVersion(context.Configuration.Compiler);
}
+ var platformBff = context.PresentPlatforms[context.Configuration.Platform];
+
var resolverParams = new[] {
new VariableAssignment("project", context.Project),
new VariableAssignment("target", context.Configuration.Target),
@@ -1353,8 +1361,7 @@ private static void GenerateBffOptions(
var platformDescriptor = PlatformRegistry.Get(context.Configuration.Platform);
context.EnvironmentVariableResolver = platformDescriptor.GetPlatformEnvironmentResolver(resolverParams);
projectOptionsGen.GenerateOptions(context);
-
- GenerateResourceCompilerOptions(context, platformDescriptor);
+ platformBff.SelectPreprocessorDefinitionsBff(context);
FillIncludeDirectoriesOptions(context);
@@ -1364,29 +1371,6 @@ private static void GenerateBffOptions(
additionalDependenciesPerConf.Add(context.Configuration, additionalDependencies);
}
- private static void GenerateResourceCompilerOptions(BffGenerationContext context, IPlatformDescriptor platformDescriptor)
- {
- Strings resourceDefines = Options.GetStrings(context.Configuration);
- if (resourceDefines.Any())
- {
- var fastBuildDefines = new List();
- string platformDefineSwitch = platformDescriptor.IsUsingClang ? "-D" : "/D";
-
- foreach (string resourceDefine in resourceDefines)
- {
- if (string.IsNullOrWhiteSpace(resourceDefine))
- continue;
-
- fastBuildDefines.Add(string.Concat(platformDefineSwitch, resourceDefine));
- }
- context.CommandLineOptions["ResourcePreprocessorDefinitions"] = string.Join($"'{Environment.NewLine} + ' ", fastBuildDefines);
- }
- else
- {
- context.CommandLineOptions["ResourcePreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
- }
- }
-
private static void FillIncludeDirectoriesOptions(BffGenerationContext context)
{
// TODO: really not ideal, refactor and move the properties we need from it someplace else
diff --git a/Sharpmake.Generators/FastBuild/IBffGenerationContext.cs b/Sharpmake.Generators/FastBuild/IBffGenerationContext.cs
new file mode 100644
index 000000000..0b6aff8d3
--- /dev/null
+++ b/Sharpmake.Generators/FastBuild/IBffGenerationContext.cs
@@ -0,0 +1,26 @@
+// Copyright (c) 2017 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.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Sharpmake.Generators.FastBuild
+{
+ public interface IBffGenerationContext : IGenerationContext
+ {
+ IReadOnlyList ProjectConfigurations { get; }
+ }
+}
diff --git a/Sharpmake.Generators/FastBuild/IPlatformBff.cs b/Sharpmake.Generators/FastBuild/IPlatformBff.cs
index a5591c7e6..9d30a19db 100644
--- a/Sharpmake.Generators/FastBuild/IPlatformBff.cs
+++ b/Sharpmake.Generators/FastBuild/IPlatformBff.cs
@@ -60,6 +60,8 @@ public interface IPlatformBff
/// `true` if a prefix is required, `false` otherwise.
bool AddLibPrefix(Configuration conf);
+ void SelectPreprocessorDefinitionsBff(IBffGenerationContext context);
+
///
/// Setups extra linker settings for linking with that platform.
///
diff --git a/Sharpmake.Generators/Properties/AssemblyInfo.cs b/Sharpmake.Generators/Properties/AssemblyInfo.cs
index 5927a79df..9f0318a89 100644
--- a/Sharpmake.Generators/Properties/AssemblyInfo.cs
+++ b/Sharpmake.Generators/Properties/AssemblyInfo.cs
@@ -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.14.1.0")]
+[assembly: AssemblyVersion("0.14.2.0")]
[assembly: InternalsVisibleTo("Sharpmake")]
diff --git a/Sharpmake.Generators/Sharpmake.Generators.csproj b/Sharpmake.Generators/Sharpmake.Generators.csproj
index d90321539..cc09870e8 100644
--- a/Sharpmake.Generators/Sharpmake.Generators.csproj
+++ b/Sharpmake.Generators/Sharpmake.Generators.csproj
@@ -68,6 +68,7 @@
+
diff --git a/Sharpmake.Generators/VisualStudio/IPlatformVcxproj.cs b/Sharpmake.Generators/VisualStudio/IPlatformVcxproj.cs
index 2d66fd6a9..11ba20137 100644
--- a/Sharpmake.Generators/VisualStudio/IPlatformVcxproj.cs
+++ b/Sharpmake.Generators/VisualStudio/IPlatformVcxproj.cs
@@ -71,6 +71,8 @@ public interface IPlatformVcxproj
void SelectApplicationFormatOptions(IGenerationContext context);
void SelectBuildType(IGenerationContext context);
+ void SelectPreprocessorDefinitionsVcxproj(IVcxprojGenerationContext context);
+
bool HasPrecomp(IGenerationContext context);
void GenerateSdkVcxproj(IVcxprojGenerationContext context, IFileGenerator generator);
diff --git a/Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs b/Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
index 25ba9cd62..c5970bab5 100644
--- a/Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
+++ b/Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
@@ -976,29 +976,6 @@ private void GenerateCompilerOptions(IGenerationContext context, ProjectOptionsG
context.CommandLineOptions["UndefinePreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
}
- // concat defines, don't add options.Defines since they are automatically added by VS
- Strings defines = new Strings();
- defines.AddRange(context.Options.ExplicitDefines);
- defines.AddRange(context.Configuration.Defines);
-
- context.Options["PreprocessorDefinitions"] = defines.JoinStrings(";");
-
- context.CommandLineOptions["PreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
- if (defines.Count > 0)
- {
- var fastBuildDefines = new List();
- string platformDefineSwitch = optionsContext.PlatformDescriptor.IsUsingClang ? "-D" : "/D";
-
- foreach (string define in defines)
- {
- if (string.IsNullOrWhiteSpace(define))
- continue;
-
- fastBuildDefines.Add(string.Concat(platformDefineSwitch, define));
- }
- context.CommandLineOptions["PreprocessorDefinitions"] = string.Join($"'{Environment.NewLine} + ' ", fastBuildDefines);
- }
-
// UndefineAllPreprocessorDefinitions
context.CommandLineOptions["UndefineAllPreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
diff --git a/Sharpmake.Generators/VisualStudio/Vcxproj.cs b/Sharpmake.Generators/VisualStudio/Vcxproj.cs
index 3be2912d2..c4e5ec022 100644
--- a/Sharpmake.Generators/VisualStudio/Vcxproj.cs
+++ b/Sharpmake.Generators/VisualStudio/Vcxproj.cs
@@ -327,6 +327,7 @@ private void GenerateConfOptions(GenerationContext context)
context.CommandLineOptions = new ProjectOptionsGenerator.VcxprojCmdLineOptions();
projectOptionsGen.GenerateOptions(context);
+ platformVcxproj.SelectPreprocessorDefinitionsVcxproj(context);
FillIncludeDirectoriesOptions(context);
FillLibrariesOptions(context);
diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs
index 339408857..76f4bb19f 100644
--- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs
+++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs
@@ -81,6 +81,50 @@ protected virtual void WriteCompilerExtraOptionsGeneral(IFileGenerator generator
public bool AddLibPrefix(Configuration conf) => true;
+ public virtual void SelectPreprocessorDefinitionsBff(IBffGenerationContext context)
+ {
+ var platformDescriptor = PlatformRegistry.Get(context.Configuration.Platform);
+ string platformDefineSwitch = platformDescriptor.IsUsingClang ? "-D" : "/D";
+
+ // concat defines, don't add options.Defines since they are automatically added by VS
+ var defines = new Strings();
+ defines.AddRange(context.Options.ExplicitDefines);
+ defines.AddRange(context.Configuration.Defines);
+
+ if (defines.Count > 0)
+ {
+ var fastBuildDefines = new List();
+
+ foreach (string define in defines)
+ {
+ if (!string.IsNullOrWhiteSpace(define))
+ fastBuildDefines.Add(string.Concat(platformDefineSwitch, define));
+ }
+ context.CommandLineOptions["PreprocessorDefinitions"] = string.Join($"'{Environment.NewLine} + ' ", fastBuildDefines);
+ }
+ else
+ {
+ context.CommandLineOptions["PreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
+ }
+
+ Strings resourceDefines = Options.GetStrings(context.Configuration);
+ if (resourceDefines.Any())
+ {
+ var fastBuildDefines = new List();
+
+ foreach (string resourceDefine in resourceDefines)
+ {
+ if (!string.IsNullOrWhiteSpace(resourceDefine))
+ fastBuildDefines.Add(string.Concat(platformDefineSwitch, resourceDefine));
+ }
+ context.CommandLineOptions["ResourcePreprocessorDefinitions"] = string.Join($"'{Environment.NewLine} + ' ", fastBuildDefines);
+ }
+ else
+ {
+ context.CommandLineOptions["ResourcePreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
+ }
+ }
+
[Obsolete("Use " + nameof(SetupExtraLinkerSettings) + " and pass the conf", error: true)]
public void SetupExtraLinkerSettings(IFileGenerator fileGenerator, Project.Configuration.OutputType outputType, string fastBuildOutputFile)
{
@@ -885,6 +929,11 @@ public void SelectBuildType(IGenerationContext context)
{
}
+ public virtual void SelectPreprocessorDefinitionsVcxproj(IVcxprojGenerationContext context)
+ {
+ throw new NotImplementedException(SimplePlatformString + " should not be called by a Vcxproj generator");
+ }
+
public bool HasPrecomp(IGenerationContext context)
{
return !string.IsNullOrEmpty(context.Configuration.PrecompHeader);
diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/BasePlatform.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/BasePlatform.cs
index d097d742d..7d321bfec 100644
--- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/BasePlatform.cs
+++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/BasePlatform.cs
@@ -66,6 +66,49 @@ public virtual bool AddLibPrefix(Configuration conf)
return false;
}
+ public virtual void SelectPreprocessorDefinitionsBff(IBffGenerationContext context)
+ {
+ var platformDescriptor = PlatformRegistry.Get(context.Configuration.Platform);
+ string platformDefineSwitch = platformDescriptor.IsUsingClang ? "-D" : "/D";
+
+ var defines = new Strings();
+ defines.AddRange(context.Options.ExplicitDefines);
+ defines.AddRange(context.Configuration.Defines);
+
+ if (defines.Count > 0)
+ {
+ var fastBuildDefines = new List();
+
+ foreach (string define in defines)
+ {
+ if (!string.IsNullOrWhiteSpace(define))
+ fastBuildDefines.Add(string.Format(@"""{0}{1}""", platformDefineSwitch, define.Replace(Util.DoubleQuotes, Util.EscapedDoubleQuotes)));
+ }
+ context.CommandLineOptions["PreprocessorDefinitions"] = string.Join($"'{Environment.NewLine} + ' ", fastBuildDefines);
+ }
+ else
+ {
+ context.CommandLineOptions["PreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
+ }
+
+ Strings resourceDefines = Options.GetStrings(context.Configuration);
+ if (resourceDefines.Any())
+ {
+ var fastBuildDefines = new List();
+
+ foreach (string resourceDefine in resourceDefines)
+ {
+ if (!string.IsNullOrWhiteSpace(resourceDefine))
+ fastBuildDefines.Add(string.Format(@"""{0}{1}""", platformDefineSwitch, resourceDefine.Replace(Util.DoubleQuotes, Util.EscapedDoubleQuotes)));
+ }
+ context.CommandLineOptions["ResourcePreprocessorDefinitions"] = string.Join($"'{Environment.NewLine} + ' ", fastBuildDefines);
+ }
+ else
+ {
+ context.CommandLineOptions["ResourcePreprocessorDefinitions"] = FileGeneratorUtilities.RemoveLineTag;
+ }
+ }
+
[Obsolete("Use " + nameof(SetupExtraLinkerSettings) + " and pass the conf")]
public virtual void SetupExtraLinkerSettings(IFileGenerator fileGenerator, Project.Configuration.OutputType outputType, string fastBuildOutputFile)
{
@@ -201,6 +244,16 @@ public virtual void SelectBuildType(IGenerationContext context)
{
}
+ public virtual void SelectPreprocessorDefinitionsVcxproj(IVcxprojGenerationContext context)
+ {
+ // concat defines, don't add options.Defines since they are automatically added by VS
+ var defines = new Strings();
+ defines.AddRange(context.Options.ExplicitDefines);
+ defines.AddRange(context.Configuration.Defines);
+
+ context.Options["PreprocessorDefinitions"] = defines.JoinStrings(";");
+ }
+
public virtual bool HasPrecomp(IGenerationContext context)
{
Project.Configuration conf = context.Configuration;
diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs
index 0bb5d5e10..fbdbfc300 100644
--- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs
+++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Properties/AssemblyInfo.cs
@@ -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.14.1.0")]
+[assembly: AssemblyVersion("0.14.2.0")]
[assembly: SharpmakeExtension]
diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs
index 8df1b6c44..0ac5eb9be 100644
--- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs
+++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Windows/BaseWindowsPlatform.cs
@@ -124,7 +124,7 @@ public override void SetupSdkOptions(IGenerationContext context)
{
systemIncludes.Sort();
if (context.Options["IncludePath"] == FileGeneratorUtilities.RemoveLineTag)
- context.Options["IncludePath"] = systemIncludes.JoinStrings(";");
+ context.Options["IncludePath"] = "$(VC_IncludePath);$(WindowsSDK_IncludePath);" + systemIncludes.JoinStrings(";");
else
context.Options["IncludePath"] += ";" + systemIncludes.JoinStrings(";");
}
diff --git a/Sharpmake.Platforms/Sharpmake.NvShield/Properties/AssemblyInfo.cs b/Sharpmake.Platforms/Sharpmake.NvShield/Properties/AssemblyInfo.cs
index 5eebb875f..98ea66df3 100644
--- a/Sharpmake.Platforms/Sharpmake.NvShield/Properties/AssemblyInfo.cs
+++ b/Sharpmake.Platforms/Sharpmake.NvShield/Properties/AssemblyInfo.cs
@@ -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.14.1.0")]
+[assembly: AssemblyVersion("0.14.2.0")]
[assembly: SharpmakeExtension]
diff --git a/Sharpmake.Platforms/Sharpmake.X360/Properties/AssemblyInfo.cs b/Sharpmake.Platforms/Sharpmake.X360/Properties/AssemblyInfo.cs
index cc0bead5a..8438bba78 100644
--- a/Sharpmake.Platforms/Sharpmake.X360/Properties/AssemblyInfo.cs
+++ b/Sharpmake.Platforms/Sharpmake.X360/Properties/AssemblyInfo.cs
@@ -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.14.1.0")]
+[assembly: AssemblyVersion("0.14.2.0")]
[assembly: SharpmakeExtension]
diff --git a/Sharpmake/Properties/AssemblyInfo.cs b/Sharpmake/Properties/AssemblyInfo.cs
index f31dd231f..45021237f 100644
--- a/Sharpmake/Properties/AssemblyInfo.cs
+++ b/Sharpmake/Properties/AssemblyInfo.cs
@@ -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.14.1.0")]
+[assembly: AssemblyVersion("0.14.2.0")]
#pragma warning disable CS7035
-[assembly: AssemblyFileVersion("0.14.1.0 (LocalBuild)")]
+[assembly: AssemblyFileVersion("0.14.2.0 (LocalBuild)")]
#pragma warning restore
[assembly: InternalsVisibleTo("Sharpmake.Application")]
diff --git a/functional_test.py b/functional_test.py
index 611ef1926..00d6eac2f 100644
--- a/functional_test.py
+++ b/functional_test.py
@@ -11,7 +11,7 @@
import select
-class FunctionalTest:
+class FunctionalTest(object):
def __init__(self, directory, script_name, project_root = ""):
self.directory = directory
self.script_name = script_name
diff --git a/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2017_win64.bff b/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2017_win64.bff
index 77f3bb5d1..3ad564952 100644
--- a/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2017_win64.bff
+++ b/samples/FastBuildSimpleExecutable/reference/projects/fastbuildsimpleexecutable_vs2017_win64.bff
@@ -32,9 +32,9 @@ ObjectList( 'FastBuildSimpleExecutable_Debug_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DWIN64'
- + ' /D_CONSOLE'
- + ' /D_DEBUG'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/D_DEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'
@@ -183,9 +183,9 @@ ObjectList( 'FastBuildSimpleExecutable_Release_win64_objects' )
// + ' /MP'
// Preprocessor options
// ---------------------------
- + ' /DNDEBUG'
- + ' /DWIN64'
- + ' /D_CONSOLE'
+ + ' "/D_CONSOLE"'
+ + ' "/DWIN64"'
+ + ' "/DNDEBUG"'
// Code Generation options
// ---------------------------
+ ' /GF'