diff --git a/toolchain/CMakeLists.txt b/toolchain/CMakeLists.txt index d331f82e8..61a861cfa 100644 --- a/toolchain/CMakeLists.txt +++ b/toolchain/CMakeLists.txt @@ -6,6 +6,7 @@ list(APPEND ep ${gcc_wrapper} mingw-w64 mingw-w64-headers + cppwinrt gcc mingw-w64-crt gendef diff --git a/toolchain/cppwinrt.cmake b/toolchain/cppwinrt.cmake new file mode 100644 index 000000000..ab33767d2 --- /dev/null +++ b/toolchain/cppwinrt.cmake @@ -0,0 +1,19 @@ +ExternalProject_Add(cppwinrt + GIT_REPOSITORY https://github.com/microsoft/cppwinrt.git + SOURCE_DIR ${SOURCE_LOCATION} + GIT_CLONE_FLAGS "--filter=tree:0" + UPDATE_COMMAND "" + CONFIGURE_COMMAND ${EXEC} CONF=1 PATH=$O_PATH cmake -H -B + -GNinja + -DCMAKE_BUILD_TYPE=Release + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + BUILD_COMMAND ${EXEC} ninja -C + INSTALL_COMMAND ${EXEC} ninja -C install + COMMAND ${EXEC} wget -O /Windows.winmd https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd + COMMAND ${EXEC} cppwinrt -input /Windows.winmd -output ${MINGW_INSTALL_PREFIX}/include/ + LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 +) + +force_rebuild_git(cppwinrt) +cleanup(cppwinrt install) diff --git a/toolchain/gcc/gcc.cmake b/toolchain/gcc/gcc.cmake index 0d88d1148..b061f4f96 100644 --- a/toolchain/gcc/gcc.cmake +++ b/toolchain/gcc/gcc.cmake @@ -35,6 +35,7 @@ ExternalProject_Add_Step(gcc final winpthreads gendef rustup + cppwinrt COMMAND ${MAKE} COMMAND ${MAKE} install-strip WORKING_DIRECTORY diff --git a/toolchain/llvm/llvm-clang.cmake b/toolchain/llvm/llvm-clang.cmake index 7ea200597..6c4a08b06 100644 --- a/toolchain/llvm/llvm-clang.cmake +++ b/toolchain/llvm/llvm-clang.cmake @@ -5,6 +5,7 @@ ExternalProject_Add(llvm-clang llvm-libcxx winpthreads gendef + cppwinrt DOWNLOAD_COMMAND "" SOURCE_DIR ${SOURCE_LOCATION} UPDATE_COMMAND ""