set "__TestBinDir=%__TestRootDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__TestIntermediatesDir=%__RootBinDir%\tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
-:: Use this variable to locate dynamically generated files; the actual location though will be different.
-set "__GeneratedIntermediatesDir=%__IntermediatesDir%\Generated_latest"
-
:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set "__CMakeBinDir=%__BinDir%"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
REM Use setlocal to restrict environment changes form vcvarsall.bat and more to just this native components build section.
setlocal EnableDelayedExpansion EnableExtensions
-if /i not "%__BuildArch%" == "arm64" goto NotArm64Build
-
+if /i "%__BuildArch%" == "arm64" (
rem arm64 builds currently use private toolset which has not been released yet
REM TODO, remove once the toolset is open.
-
-if /i "%__ToolsetDir%" == "" (
- echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolset_dir argument.
- exit /b 1
-)
-
-set PATH=%PATH%;%__ToolsetDir%\cpp\bin
-set LIB=%__ToolsetDir%\OS\lib;%__ToolsetDir%\cpp\lib
-set INCLUDE=^
-%__ToolsetDir%\cpp\inc;^
-%__ToolsetDir%\OS\inc\Windows;^
-%__ToolsetDir%\OS\inc\Windows\crt;^
-%__ToolsetDir%\cpp\inc\vc;^
-%__ToolsetDir%\OS\inc\win8
+call :PrivateToolSet
goto GenVSSolution
-
-:NotArm64Build
+)
:: Set the environment for the native build
set __VCBuildArch=x86_amd64
set "__BuildtestArgs=%__BuildtestArgs% Priority %__TestPriority%"
)
+rem arm64 builds currently use private toolset which has not been released yet
+REM TODO, remove once the toolset is open.
+if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
+
call %__ProjectDir%\tests\buildtest.cmd %__BuildtestArgs%
if errorlevel 1 (
You need Visual Studio 2015+ (Community is free).
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1
+
+:PrivateToolSet
+
+echo %__MsgPrefix% Setting Up the usage of __ToolsetDir:%__ToolsetDir%
+
+if /i "%__ToolsetDir%" == "" (
+ echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolset_dir argument.
+ exit /b 1
+)
+
+set PATH=%PATH%;%__ToolsetDir%\cpp\bin
+set LIB=%__ToolsetDir%\OS\lib;%__ToolsetDir%\cpp\lib
+set INCLUDE=^
+%__ToolsetDir%\cpp\inc;^
+%__ToolsetDir%\OS\inc\Windows;^
+%__ToolsetDir%\OS\inc\Windows\crt;^
+%__ToolsetDir%\cpp\inc\vc;^
+%__ToolsetDir%\OS\inc\win8
+exit /b 0
break
case 'arm64':
assert scenario == 'default'
- buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} skiptestbuild /toolset_dir C:\\ats"
+ buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats"
if (lowerConfiguration == "release") {
buildCommands += "C:\\arm64PostBuild.cmd %WORKSPACE% ${architecture} ${lowerConfiguration}"
set(INC_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common/Platform)
if (WIN32)
add_definitions(-DWINDOWS=1)
+
+ if (DEFINED ENV{__ToolsetDir})
+ # Hack for private Tool Set
+ # CMAKE_CXX_COMPILER will default to the compiler installed with
+ # Visual studio. Overwrite it to the compiler on the path.
+
+ find_program(PATH_CXX_COMPILER cl)
+ set(CMAKE_CXX_COMPILER ${PATH_CXX_COMPILER})
+
+ message("Overwriting the CMAKE_CXX_COMPILER.")
+ message("CMAKE_CXX_COMPILER found:${CMAKE_CXX_COMPILER}")
+
+ # Temporary until cmake has VS generators for hacky toolsets [arm64]
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:${CLR_CMAKE_TARGET_ARCH}")
+ set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /machine:${CLR_CMAKE_TARGET_ARCH}")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:${CLR_CMAKE_TARGET_ARCH}")
+ endif()
endif()
# Compile options
if not defined __TestIntermediateDir (
set "__TestIntermediateDir=tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
)
-set "__NativeTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDirDir%\Native"
+set "__NativeTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Native"
set "__ManagedTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Managed"
:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
echo %__MsgPrefix%Commencing build of native test components for %__BuildArch%/%__BuildType%
+if defined __ToolsetDir (
+ echo %__MsgPrefix%ToolsetDir is defined to be :%__ToolsetDir%
+ goto GenVSSolution :: Private ToolSet is Defined
+)
+
:: Set the environment for the native build
echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\..\..\VC\vcvarsall.bat" %__VCBuildArch%
call "%__VSToolsRoot%\..\..\VC\vcvarsall.bat" x86_amd64
)
if not exist "%VSINSTALLDIR%DIA SDK" goto NoDIA
-echo %__MsgPrefix%Regenerating the Visual Studio solution
+:GenVSSolution
+echo %__MsgPrefix%Regenerating the Visual Studio solution in %__NativeTestIntermediatesDir%
pushd "%__NativeTestIntermediatesDir%"
call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectFilesDir%\" %__VSVersion% %__BuildArch%
exit /b 1
)
+set __msbuildNativeArgs=%__msbuildCleanBuildArgs% /p:Configuration=%__BuildType%
+
+if defined __ToolsetDir (
+ set __msbuildNativeArgs=%__msbuildNativeArgs% /p:UseEnv=true
+) else (
+ set __msbuildNativeArgs=%__msbuildNativeArgs% /p:Platform=%__BuildArch%
+)
+
set __BuildLogRootName=Tests_Native
-call :msbuild "%__NativeTestIntermediatesDir%\install.vcxproj" %__msbuildCleanBuildArgs% /p:Configuration=%__BuildType% /p:Platform=%__BuildArch%
+call :msbuild "%__NativeTestIntermediatesDir%\install.vcxproj" %__msbuildNativeArgs%
if errorlevel 1 exit /b 1
-
REM endlocal to rid us of environment changes from vcvarsall.bat
endlocal
// dllexport
#if defined _WIN32
#define DLL_EXPORT __declspec(dllexport)
+
+#ifndef snprintf
+#define snprintf _snprintf
+#endif //snprintf
+
#else //!_Win32
#if __GNUC__ >= 4
#define DLL_EXPORT __attribute__ ((visibility ("default")))