Skip to content

Commit

Permalink
Fix windows build for NativeAOT/GuardCF
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossanlop committed May 17, 2024
1 parent 791ef10 commit be897a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function(preprocess_file inputFilename outputFilename)
get_compile_definitions(PREPROCESS_DEFINITIONS)
get_include_directories(PREPROCESS_INCLUDE_DIRECTORIES)
get_source_file_property(SOURCE_FILE_DEFINITIONS ${inputFilename} COMPILE_DEFINITIONS)

foreach(DEFINITION IN LISTS SOURCE_FILE_DEFINITIONS)
list(APPEND PREPROCESS_DEFINITIONS -D${DEFINITION})
endforeach()
Expand Down Expand Up @@ -508,7 +508,7 @@ function(install_static_library targetName destination component)
if (WIN32)
set_target_properties(${targetName} PROPERTIES
COMPILE_PDB_NAME "${targetName}"
COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
COMPILE_PDB_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${targetName}>"
)
install (FILES "$<TARGET_FILE_DIR:${targetName}>/${targetName}.pdb" DESTINATION ${destination} COMPONENT ${component})
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeLibrary Condition="'$(_targetArchitecture)' == 'x64'" Include="$(IlcSdkPath)$(VxSortSupportName)$(LibrarySuffix)" />
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
<NativeLibrary Include="$(IlcSdkPath)$(StandaloneGCSupportName)$(LibrarySuffix)" />
<NativeLibrary Include="$(IlcSdkPath)zlibstatic$(LibFileExt)" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/native/external/zlib-ng.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ if (MSVC)
# add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd9025>) # Caused by zlib-ng/CMakeLists.txt:186 Command line error D9025: overriding '/W4' with '/W3'
endif()

FetchContent_MakeAvailable(fetchzlibng)
set(SKIP_INSTALL_ALL ON)
FetchContent_MakeAvailable(fetchzlibng)
set(SKIP_INSTALL_ALL OFF)
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ else ()
endif ()

if(STATIC_LIBS_ONLY)
install_static_library(zlibstatic aotsdk nativeaot)
install_static_library(System.IO.Compression.Native.Aot aotsdk nativeaot)
install_static_library(System.IO.Compression.Native.Aot.GuardCF aotsdk nativeaot)
endif()
Expand Down

0 comments on commit be897a6

Please sign in to comment.