Generate ClrJit.exports.def at compile time on Windows.
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Wed, 10 Apr 2019 21:48:31 +0000 (14:48 -0700)
committerJeremy Koritzinsky <jekoritz@microsoft.com>
Thu, 11 Apr 2019 17:20:32 +0000 (10:20 -0700)
src/jit/CMakeLists.txt
src/jit/ClrJit.exports

index 0977fc1..3d8a24b 100644 (file)
@@ -295,20 +295,8 @@ set (CLRJIT_EXPORTS ${CMAKE_CURRENT_LIST_DIR}/ClrJit.exports)
 
 if(WIN32)
   add_precompiled_header(jitpch.h ../jitpch.cpp SOURCES)
-
-  # Create .def file containing a list of exports preceeded by
-  # 'EXPORTS'.  The file "ClrJit.exports" already contains the list, so we
-  # massage it into the correct format here to create "ClrJit.exports.def".
   set(JIT_EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/ClrJit.exports.def)
-  set(JIT_EXPORTS_FILE_TEMP ${JIT_EXPORTS_FILE}.txt)
-  file(READ ${CLRJIT_EXPORTS} exports_list)
-  file(WRITE ${JIT_EXPORTS_FILE_TEMP} "LIBRARY CLRJIT\n")
-  file(APPEND ${JIT_EXPORTS_FILE_TEMP} "EXPORTS\n")
-  file(APPEND ${JIT_EXPORTS_FILE_TEMP} ${exports_list})
-
-  # Copy the file only if it has changed.
-  execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
-    ${JIT_EXPORTS_FILE_TEMP} ${JIT_EXPORTS_FILE})
+  preprocess_def_file (${CLRJIT_EXPORTS} ${JIT_EXPORTS_FILE})
 
   set(SHARED_LIB_SOURCES ${SOURCES} ${JIT_EXPORTS_FILE})
 else()
index 0126e63..60a223b 100644 (file)
@@ -1,3 +1,8 @@
-getJit
-jitStartup
-sxsJitStartup
+; Licensed to the .NET Foundation under one or more agreements.
+; The .NET Foundation licenses this file to you under the MIT license.
+; See the LICENSE file in the project root for more information.
+
+EXPORTS
+    getJit
+    jitStartup
+    sxsJitStartup