aboutsummaryrefslogtreecommitdiffstats
path: root/find_java
diff options
context:
space:
mode:
authorDavid Herman <davidherman@google.com>2014-10-23 10:32:17 -0700
committerDavid Herman <davidherman@google.com>2014-11-14 00:12:48 +0000
commitb5298b16a14cc23b3072401bde45e9bf8720f00f (patch)
treef9cb2ed8c32eb3b8d06c35bd81f921cb69b30542 /find_java
parent4f44cf72bc552a666b0fa89b2f3141ab97cd1aa1 (diff)
downloadsdk-b5298b16a14cc23b3072401bde45e9bf8720f00f.zip
sdk-b5298b16a14cc23b3072401bde45e9bf8720f00f.tar.gz
sdk-b5298b16a14cc23b3072401bde45e9bf8720f00f.tar.bz2
Modifed find_java.bat and build settings
Find Java now statically links in all MFC / Windows dependencies, as well as it builds to find_java32.exe and find_java64.exe. find_java.bat has been updated to take advantage of these new names. Change-Id: Iaa50d461074235dd9db750201d6e033058a2e695
Diffstat (limited to 'find_java')
-rwxr-xr-xfind_java/find_java.bat9
-rw-r--r--find_java/find_java_exe.vcxproj22
2 files changed, 23 insertions, 8 deletions
diff --git a/find_java/find_java.bat b/find_java/find_java.bat
index e7bc590..b1b7dd1 100755
--- a/find_java/find_java.bat
+++ b/find_java/find_java.bat
@@ -21,15 +21,20 @@ rem Useful links:
rem Command-line reference:
rem http://technet.microsoft.com/en-us/library/bb490890.aspx
+rem Query whether this system is 32-bit or 64-bit
+rem See also: http://stackoverflow.com/a/24590583/1299302
+reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" |^
+find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64
+
rem Check we have a valid Java.exe in the path. The return code will
rem be 0 if the command worked or 1 if the exec failed (program not found).
-for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do set java_exe=%%a
+for /f "delims=" %%a in ('"%~dps0\find_java%arch_ext%.exe" -s') do set java_exe=%%a
if not defined java_exe goto :CheckFailed
:SearchJavaW
rem Check if we can find a javaw.exe at the same location than java.exe.
rem If that doesn't work, just fall back on the java.exe we just found.
-for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s -w') do set javaw_exe=%%a
+for /f "delims=" %%a in ('"%~dps0\find_java%arch_ext%.exe" -s -w') do set javaw_exe=%%a
if not exist "%javaw_exe%" set javaw_exe=%java_exe%
goto :EOF
diff --git a/find_java/find_java_exe.vcxproj b/find_java/find_java_exe.vcxproj
index 215a978..67ebf71 100644
--- a/find_java/find_java_exe.vcxproj
+++ b/find_java/find_java_exe.vcxproj
@@ -29,19 +29,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
+ <UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
+ <UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -73,8 +77,10 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\out\host\windows-x64\$(Configuration)\$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)64</TargetName>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)64</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">find_java64</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">find_java64</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)32</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">find_java32</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -82,7 +88,7 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
@@ -92,6 +98,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>user32.lib;advapi32.lib;shell32.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -99,7 +106,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
@@ -108,6 +115,7 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
+ <AdditionalDependencies>user32.lib;advapi32.lib;shell32.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -115,7 +123,7 @@
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -128,6 +136,7 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>user32.lib;advapi32.lib;shell32.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -135,7 +144,7 @@
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -147,6 +156,7 @@
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <AdditionalDependencies>user32.lib;advapi32.lib;shell32.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>