| 1 | set(SOURCES |
| 2 | main.cpp |
| 3 | binfmt.cpp |
| 4 | config.cpp |
| 5 | DnsServer.cpp |
| 6 | DnsTunnelingChannel.cpp |
| 7 | DnsTunnelingManager.cpp |
| 8 | drvfs.cpp |
| 9 | escape.cpp |
| 10 | GnsEngine.cpp |
| 11 | GnsPortTracker.cpp |
| 12 | init.cpp |
| 13 | localhost.cpp |
| 14 | Localization.cpp |
| 15 | NetworkManager.cpp |
| 16 | plan9.cpp |
| 17 | telemetry.cpp |
| 18 | timezone.cpp |
| 19 | SecCompDispatcher.cpp |
| 20 | util.cpp |
| 21 | WslDistributionConfig.cpp |
| 22 | wslinfo.cpp |
| 23 | wslpath.cpp |
| 24 | WSLCInit.cpp) |
| 25 | |
| 26 | set(HEADERS |
| 27 | ../inc/lxwil.h |
| 28 | binfmt.h |
| 29 | common.h |
| 30 | config.h |
| 31 | DnsServer.h |
| 32 | DnsTunnelingChannel.h |
| 33 | DnsTunnelingManager.h |
| 34 | drvfs.h |
| 35 | escape.h |
| 36 | GnsEngine.h |
| 37 | GnsPortTracker.h |
| 38 | localhost.h |
| 39 | NetworkManager.h |
| 40 | plan9.h |
| 41 | telemetry.h |
| 42 | timezone.h |
| 43 | SecCompDispatcher.h |
| 44 | util.h |
| 45 | WslDistributionConfig.h |
| 46 | wslinfo.h |
| 47 | wslpath.h) |
| 48 | |
| 49 | set(LINUX_CXXFLAGS ${LINUX_CXXFLAGS} -I "${CMAKE_CURRENT_LIST_DIR}/../netlinkutil") |
| 50 | set(INIT_LIBRARIES ${COMMON_LINUX_LINK_LIBRARIES} netlinkutil plan9 mountutil configfile) |
| 51 | add_linux_executable(init "${SOURCES}" "${HEADERS};${COMMON_LINUX_HEADERS}" "${INIT_LIBRARIES}") |
| 52 | add_dependencies(init localization) |
| 53 | |
| 54 | set_target_properties(init PROPERTIES FOLDER linux) |
| 55 | |
| 56 | set(INITRAMFS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/initrd.img) |
| 57 | set(INIT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/init) |
| 58 | add_custom_command( |
| 59 | OUTPUT ${INITRAMFS} "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/initramfs" |
| 60 | DEPENDS init ${INIT} |
| 61 | COMMAND powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File "${CMAKE_SOURCE_DIR}/tools/create-initrd.ps1" "${INIT}" "${INITRAMFS}" |
| 62 | COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/initramfs" |
| 63 | VERBATIM) |
| 64 | add_custom_target(initramfs DEPENDS ${INITRAMFS}) |
| 65 | set_target_properties(initramfs PROPERTIES FOLDER linux) |