mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 00:44:55 -06:00
Many Microsoft employees have contributed to the Windows Subsystem for Linux, this commit is the result of their work since 2016. The entire history of the Windows Subsystem for Linux can't be shared here, but here's an overview of WSL's history after it moved to it own repository in 2021: Number of commits on the main branch: 2930 Number of contributors: 31 Head over https://github.com/microsoft/WSL/releases for a more detailed history of the features added to WSL since 2021.
57 lines
2.0 KiB
CMake
57 lines
2.0 KiB
CMake
set(BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
|
|
set(OUTPUT_PACKAGE ${BIN}/wsl.msi)
|
|
set(PACKAGE_WIX_IN ${CMAKE_CURRENT_LIST_DIR}/package.wix.in)
|
|
set(PACKAGE_WIX ${BIN}/package.wix)
|
|
set(CAB_CACHE ${BIN}/cab)
|
|
set(BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;init;initrd.img;wslinstall.dll)
|
|
|
|
if (WSL_BUILD_WSL_SETTINGS)
|
|
list(APPEND BINARIES_DEPENDENCIES "wslsettings/wslsettings.dll;wslsettings/wslsettings.exe;libwsl.dll")
|
|
endif()
|
|
|
|
set(BINARIES_DEPENDENCIES)
|
|
foreach(binary ${BINARIES})
|
|
list(APPEND BINARIES_DEPENDENCIES "${BIN}/${binary}")
|
|
endforeach()
|
|
|
|
if (${WSL_BUILD_THIN_PACKAGE})
|
|
set(COMPRESS_PACKAGE "no")
|
|
else()
|
|
set(COMPRESS_PACKAGE "yes")
|
|
endif()
|
|
|
|
configure_file(${PACKAGE_WIX_IN} ${PACKAGE_WIX})
|
|
file(MAKE_DIRECTORY ${CAB_CACHE})
|
|
|
|
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
set(COMPRESSION "high")
|
|
else()
|
|
set(COMPRESSION "none")
|
|
endif()
|
|
|
|
add_custom_command(
|
|
OUTPUT ${OUTPUT_PACKAGE}
|
|
COMMAND ${WIX_SOURCE_DIR}/wix.exe build ${PACKAGE_WIX} -o ${OUTPUT_PACKAGE} -arch ${TARGET_PLATFORM} -dcl ${COMPRESSION} -cc ${CAB_CACHE} -pdbtype none
|
|
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/msipackage"
|
|
VERBATIM
|
|
DEPENDS ${PACKAGE_WIX} ${BINARIES_DEPENDENCIES} # Make sure the package is rebuilt if any of the binaries or resources change
|
|
)
|
|
|
|
add_custom_target(msipackage DEPENDS ${OUTPUT_PACKAGE})
|
|
set_target_properties(msipackage PROPERTIES EXCLUDE_FROM_ALL FALSE SOURCES ${PACKAGE_WIX_IN})
|
|
add_dependencies(msipackage wsl wslg wslservice wslhost wslrelay wslserviceproxystub init initramfs wslinstall msixgluepackage)
|
|
|
|
if (WSL_BUILD_WSL_SETTINGS)
|
|
add_dependencies(msipackage wslsettings libwsl)
|
|
endif()
|
|
|
|
set_source_files_properties(${OUTPUT_PACKAGE} PROPERTIES GENERATED TRUE)
|
|
|
|
if (DEFINED WSL_POST_BUILD_COMMAND)
|
|
add_custom_command(
|
|
TARGET msipackage
|
|
POST_BUILD
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
USES_TERMINAL
|
|
COMMAND ${WSL_POST_BUILD_COMMAND} -Platform ${TARGET_PLATFORM} -BuildType ${CMAKE_BUILD_TYPE})
|
|
endif() |