Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subfolder and CMakeLists.txt for mscorlib.winmd #449

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ endif()

add_subdirectory(Dependencies)

set(SWIFTWINRT_EXE_STAGING_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(GENERATOR_STAGING_DIR "${CMAKE_CURRENT_BINARY_DIR}")
add_subdirectory(Sources)
add_subdirectory(mscorlib)

include(mscorlib.cmake)
add_subdirectory(NuGet)
9 changes: 4 additions & 5 deletions Generator/Sources/SwiftWinRT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ target_link_libraries(SwiftWinRT PRIVATE
DotNetMetadata DotNetMetadataFormat WindowsMetadata
CodeWriters ProjectionModel)

if(DEFINED SWIFTWINRT_EXE_STAGING_DIR)
add_custom_command(TARGET SwiftWinRT
POST_BUILD
if(DEFINED GENERATOR_STAGING_DIR)
add_custom_command(TARGET SwiftWinRT POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_BINARY_DIR}/SwiftWinRT.exe"
"${SWIFTWINRT_EXE_STAGING_DIR}/SwiftWinRT.exe"
BYPRODUCTS "${SWIFTWINRT_EXE_STAGING_DIR}/SwiftWinRT.exe")
"${GENERATOR_STAGING_DIR}/SwiftWinRT.exe"
BYPRODUCTS "${GENERATOR_STAGING_DIR}/SwiftWinRT.exe")
endif()
10 changes: 0 additions & 10 deletions Generator/mscorlib.cmake

This file was deleted.

20 changes: 20 additions & 0 deletions Generator/mscorlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Assemble DotNetMetadata's mscorlib.il into mscorlib.winmd,
# which is required by the code generator.
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mscorlib.winmd"
COMMAND powershell.exe -File "${WINMDCORLIB_DIR}/Assemble.ps1"
-SourcePath "${WINMDCORLIB_DIR}/mscorlib.il"
-OutputPath "${CMAKE_CURRENT_BINARY_DIR}/mscorlib.winmd"
DEPENDS
"${WINMDCORLIB_DIR}/Assemble.ps1"
"${WINMDCORLIB_DIR}/mscorlib.il")

add_custom_target(mscorlib ALL
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/mscorlib.winmd")

if(DEFINED GENERATOR_STAGING_DIR)
add_custom_command(TARGET mscorlib POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_BINARY_DIR}/mscorlib.winmd"
"${GENERATOR_STAGING_DIR}/mscorlib.winmd"
BYPRODUCTS "${GENERATOR_STAGING_DIR}/mscorlib.winmd")
endif()
Loading