diff --git a/definitionsconsistencycheck.cmake b/definitionsconsistencycheck.cmake
index cc029bb79954..51a70f72096b 100644
--- a/definitionsconsistencycheck.cmake
+++ b/definitionsconsistencycheck.cmake
@@ -1,11 +1,11 @@
get_directory_property( DirDefs COMPILE_DEFINITIONS )
# Reset the definition file
-file(WRITE cmake.definitions "")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/cmake.definitions "")
foreach( d ${DirDefs} )
if($ENV{VERBOSE})
message( STATUS "Compiler Definition: " ${d} )
endif($ENV{VERBOSE})
- file(APPEND cmake.definitions ${d})
- file(APPEND cmake.definitions "\n")
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/cmake.definitions ${d})
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/cmake.definitions "\n")
endforeach()
diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj
index 02719e3ebabf..6285e4a3174d 100644
--- a/src/mscorlib/System.Private.CoreLib.csproj
+++ b/src/mscorlib/System.Private.CoreLib.csproj
@@ -183,8 +183,9 @@
FEATURE_IMPLICIT_TLS;FEATURE_HIJACK
+ $(IntermediateOutputPath)\cmake.definitions
-
+
diff --git a/src/scripts/check-definitions.py b/src/scripts/check-definitions.py
index ace70786b92d..59b309a3e600 100644
--- a/src/scripts/check-definitions.py
+++ b/src/scripts/check-definitions.py
@@ -33,7 +33,12 @@
# For the native part, return the sorted definition array.
def loadDefinitionFile(filename):
result = []
- f = open(filename, 'r')
+ try:
+ f = open(filename, 'r')
+ except:
+ sys.exit(0)
+ # if cmake was not used (because of skipnative or systems that do not use cmake), this script won't work.
+
for line in f:
theLine = line.rstrip("\r\n").strip()
if (len(theLine) > 0):