1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

CMake: fix build on Windows

This commit is contained in:
Xorg 2020-05-22 22:06:34 +02:00
parent c129bc23a4
commit 7c7fd3b565
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A
2 changed files with 9 additions and 3 deletions

View file

@ -12,7 +12,11 @@ if("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64")
list(APPEND cpuid_sources masm-x64.asm)
endif()
add_library(cpuid SHARED ${cpuid_sources})
if(UNIX)
add_library(cpuid SHARED ${cpuid_sources})
else()
add_library(cpuid ${cpuid_sources})
endif()
target_include_directories(cpuid SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_compile_definitions(cpuid PRIVATE VERSION="${PROJECT_VERSION}")

View file

@ -1,5 +1,7 @@
add_executable(convert_instlatx64 convert_instlatx64.c)
target_link_libraries(convert_instlatx64 PUBLIC cpuid)
if(UNIX)
add_executable(convert_instlatx64 convert_instlatx64.c)
target_link_libraries(convert_instlatx64 PUBLIC cpuid)
endif(UNIX)
add_custom_target(test DEPENDS test-fast)