Skip to content

Commit

Permalink
Don't check for SHGetKnownFolderPath when building for UWP
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 7, 2025
1 parent 0eb748a commit e04712e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,17 @@ if(WIN32)
option(ALSOFT_BUILD_IMPORT_LIB "Build an import .lib using dlltool (requires sed)" ON)
endif()

# Some systems may need NTDDI_VERSION defined to NTDDI_VISTA or later
check_cxx_source_compiles("#include <shlobj.h>
int main()
{
SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_DONT_UNEXPAND, nullptr, nullptr);
return 0;
}" HAVE_SHGETKNOWNFOLDERPATH_NO_NTDDI)
if(NOT HAVE_SHGETKNOWNFOLDERPATH_NO_NTDDI)
set(CPP_DEFS ${CPP_DEFS} NTDDI_VERSION=NTDDI_VISTA)
if(NOT ALSOFT_UWP)
# Some systems may need NTDDI_VERSION defined to NTDDI_VISTA or later
check_c_source_compiles("#include <shlobj.h>
int main()
{
SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_DONT_UNEXPAND, NULL, NULL);
return 0;
}" HAVE_SHGETKNOWNFOLDERPATH_NO_NTDDI)
if(NOT HAVE_SHGETKNOWNFOLDERPATH_NO_NTDDI)
set(CPP_DEFS ${CPP_DEFS} NTDDI_VERSION=NTDDI_VISTA)
endif()
endif()
elseif(APPLE)
option(ALSOFT_OSX_FRAMEWORK "Build as macOS framework" OFF)
Expand Down

0 comments on commit e04712e

Please sign in to comment.