Skip to content

Commit

Permalink
toolchain: add cppwinrt
Browse files Browse the repository at this point in the history
This will enable smtc support in mpv
  • Loading branch information
Andarwinux authored and shinchiro committed Aug 3, 2024
1 parent 86a522a commit 78564b0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions toolchain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND ep
${gcc_wrapper}
mingw-w64
mingw-w64-headers
cppwinrt
gcc
mingw-w64-crt
gendef
Expand Down
19 changes: 19 additions & 0 deletions toolchain/cppwinrt.cmake
Original file line number Diff line number Diff line change
@@ -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<SOURCE_DIR> -B<BINARY_DIR>
-GNinja
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
BUILD_COMMAND ${EXEC} ninja -C <BINARY_DIR>
INSTALL_COMMAND ${EXEC} ninja -C <BINARY_DIR> install
COMMAND ${EXEC} wget -O <BINARY_DIR>/Windows.winmd https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd
COMMAND ${EXEC} cppwinrt -input <BINARY_DIR>/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)
1 change: 1 addition & 0 deletions toolchain/gcc/gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ExternalProject_Add_Step(gcc final
winpthreads
gendef
rustup
cppwinrt
COMMAND ${MAKE}
COMMAND ${MAKE} install-strip
WORKING_DIRECTORY <BINARY_DIR>
Expand Down
1 change: 1 addition & 0 deletions toolchain/llvm/llvm-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ExternalProject_Add(llvm-clang
llvm-libcxx
winpthreads
gendef
cppwinrt
DOWNLOAD_COMMAND ""
SOURCE_DIR ${SOURCE_LOCATION}
UPDATE_COMMAND ""
Expand Down

0 comments on commit 78564b0

Please sign in to comment.