Build: Fix xxhash on non-Windows

This commit is contained in:
Connor McLaughlin 2020-12-26 00:41:59 +10:00
parent b755798c2a
commit af3b2b0e15
3 changed files with 21 additions and 4 deletions

View file

@ -1,10 +1,17 @@
set(SRCS set(SRCS
include/xxh3.h
include/xxhash.h include/xxhash.h
src/xxhash.c src/xxhash.c
) )
add_library(xxhash ${SRCS}) add_library(xxhash ${SRCS})
if(${CPU_ARCH} STREQUAL "x86" OR ${CPU_ARCH} STREQUAL "x64")
target_sources(xxhash PRIVATE
include/xxh_x86dispatch.h
src/xxh_x86dispatch.c
)
endif()
target_include_directories(xxhash PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(xxhash PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(xxhash INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(xxhash INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_compile_definitions(xxhash INTERFACE "XXH_STATIC_LINKING_ONLY") target_compile_definitions(xxhash INTERFACE "XXH_STATIC_LINKING_ONLY")

View file

@ -52,11 +52,21 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="src\xxhash.c" /> <ClCompile Include="src\xxhash.c" />
<ClCompile Include="src\xxh_x86dispatch.c" /> <ClCompile Include="src\xxh_x86dispatch.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugFast|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="include\xxhash.h" /> <ClInclude Include="include\xxhash.h" />
<ClInclude Include="include\xxh_x86dispatch.h" /> <ClInclude Include="include\xxh_x86dispatch.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugFast|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
</ClInclude>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{09553C96-9F39-49BF-8AE6-7ACBD07C410C}</ProjectGuid> <ProjectGuid>{09553C96-9F39-49BF-8AE6-7ACBD07C410C}</ProjectGuid>

View file

@ -114,7 +114,7 @@ set(RECOMPILER_SRCS
target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(core PUBLIC Threads::Threads common zlib vulkan-loader) target_link_libraries(core PUBLIC Threads::Threads common zlib vulkan-loader)
target_link_libraries(core PRIVATE glad stb) target_link_libraries(core PRIVATE glad stb xxhash)
if(WIN32) if(WIN32)
target_sources(core PRIVATE target_sources(core PRIVATE