Skip to content

Commit

Permalink
src: add TaskScheduler dll
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsh committed Nov 18, 2023
1 parent 5795382 commit b056b36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ struct
structs
sublang
swprintf
taskscheduler
tatsh
testlist
tlbid
Expand Down
11 changes: 9 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREA
add_library(
PSWinPrefs SHARED LibPrefs.cs RegisterSavePreferencesScheduledTask.cs SavePreferences.cs
UnregisterSavePreferencesScheduledTask.cs WriteRegCommands.cs)
set(TASKSCHEDULER_VERSION 2.10.1)
set_target_properties(
PSWinPrefs
PROPERTIES DOTNET_SDK "Microsoft.NET.Sdk"
DOTNET_TARGET_FRAMEWORK "net6.0"
VS_GLOBAL_EnforceCodeStyleInBuild True
VS_GLOBAL_ImplicitUsings enable
VS_GLOBAL_Nullable enable
VS_PACKAGE_REFERENCES "Microsoft.PowerShell.SDK_7.2.7;TaskScheduler_2.10.1")
VS_PACKAGE_REFERENCES
"Microsoft.PowerShell.SDK_7.2.7;TaskScheduler_${TASKSCHEDULER_VERSION}")
target_compile_options(PSWinPrefs PRIVATE "/unsafe")
install(FILES WinPrefs.psd1 DESTINATION WinPrefs)
set(NUGET_PACKAGES_DIR $ENV{HOME}/.nuget/packages)
install(
FILES
WinPrefs.psd1
"${NUGET_PACKAGES_DIR}/taskscheduler/${TASKSCHEDULER_VERSION}/lib/net6.0-windows7.0/Microsoft.Win32.TaskScheduler.dll"
DESTINATION WinPrefs)
install(TARGETS PSWinPrefs winprefsw prefs DESTINATION WinPrefs)
endif()

0 comments on commit b056b36

Please sign in to comment.