Remove c++ compiler warnings (dotnet/core-setup#4240)
authorSteve Harter <steveharter@users.noreply.github.com>
Mon, 18 Jun 2018 19:29:22 +0000 (14:29 -0500)
committerGitHub <noreply@github.com>
Mon, 18 Jun 2018 19:29:22 +0000 (14:29 -0500)
Commit migrated from https://github.com/dotnet/core-setup/commit/de79ed253a789809e12643f2911965f2073ea93a

src/installer/corehost/cli/dll/CMakeLists.txt
src/installer/corehost/cli/exe/apphost/CMakeLists.txt
src/installer/corehost/cli/exe/dotnet/CMakeLists.txt
src/installer/corehost/cli/exe/exe.cmake
src/installer/corehost/cli/fxr/CMakeLists.txt
src/installer/corehost/cli/runtime_config.cpp
src/installer/corehost/common/utils.cpp
src/installer/test/HostActivationTests/GivenThatICareAboutDotnetArgValidationScenarios.cs

index 95e33c0..21af6d6 100644 (file)
@@ -10,10 +10,9 @@ if(WIN32)
     add_compile_options($<$<CONFIG:Debug>:/MTd>)
 else()
     add_compile_options(-fPIC)
+    add_compile_options(-fvisibility=hidden)
 endif()
 
-add_compile_options(-fvisibility=hidden)
-
 include(../setup.cmake)
 
 # Include directories
index fb0666f..990592a 100644 (file)
@@ -5,8 +5,6 @@ cmake_minimum_required (VERSION 2.6)
 project(apphost)
 set(DOTNET_HOST_EXE_NAME "apphost")
 
-add_compile_options(-fvisibility=hidden)
-
 # Add RPATH to the apphost binary that allows using local copies of shared libraries
 # dotnet core depends on for special scenarios when system wide installation of such 
 # dependencies is not possible for some reason.
index a0de6e1..b8b0763 100644 (file)
@@ -4,7 +4,6 @@
 cmake_minimum_required (VERSION 2.6)
 project(dotnet)
 set(DOTNET_HOST_EXE_NAME "dotnet")
-add_compile_options(-fvisibility=hidden)
 set(SOURCES 
     ../../fxr/fx_ver.cpp)
 include(../exe.cmake)
index 37289d1..7ae6a2c 100644 (file)
@@ -8,6 +8,7 @@ if(WIN32)
     add_compile_options($<$<CONFIG:Debug>:/MTd>)
 else()
     add_compile_options(-fPIE)
+    add_compile_options(-fvisibility=hidden)
 endif()
 
 include(../../setup.cmake)
index bd56dff..3d554bb 100644 (file)
@@ -10,10 +10,9 @@ if(WIN32)
     add_compile_options($<$<CONFIG:Debug>:/MTd>)
 else()
     add_compile_options(-fPIC)
+    add_compile_options(-fvisibility=hidden)
 endif()
 
-add_compile_options(-fvisibility=hidden)
-
 include(../setup.cmake)
 
 # Include directories
index 48198cf..9a441f9 100644 (file)
@@ -85,7 +85,7 @@ bool runtime_config_t::parse_opts(const json_value& opts)
         {
             m_properties[property.first] = property.second.is_string()
                 ? property.second.as_string()
-                : property.second.to_string();
+                : property.second.serialize();
         }
     }
 
index 0f701f7..797bd07 100644 (file)
@@ -226,9 +226,8 @@ bool parse_known_args(
     {
         pal::string_t arg = argv[arg_i];
         pal::string_t arg_lower = pal::to_lower(arg);
-        if (std::find_if(known_opts.begin(), known_opts.end(), 
-                        [&value_to_look = arg_lower]
-                        (const host_option& hostoption) -> bool { return value_to_look == hostoption.option; })
+        if (std::find_if(known_opts.begin(), known_opts.end(),
+            [&](const host_option& hostoption) { return arg_lower == hostoption.option; })
             == known_opts.end())
         {
             // Unknown argument.
index c129abc..bf2575f 100644 (file)
@@ -88,6 +88,23 @@ namespace Microsoft.DotNet.CoreSetup.Test.HostActivation.ArgValidation
                 .HaveStdErrContaining($"dotnet exec needs a managed .dll or .exe extension. The application specified was '{assemblyName}'");
         }
 
+        [Fact]
+        public void Detect_Missing_Argument_Value()
+        {
+            var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture
+                .Copy();
+
+            var dotnet = fixture.BuiltDotnet;
+
+            dotnet.Exec("--fx-version")
+                .CaptureStdOut()
+                .CaptureStdErr()
+                .Execute()
+                .Should()
+                .Fail()
+                .And
+                .HaveStdErrContaining($"Failed to parse supported options or their values:");
+        }
 
         // Return a non-exisitent path that contains a mix of / and \
         private string GetNonexistentAndUnnormalizedPath()