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:
parent
c129bc23a4
commit
7c7fd3b565
2 changed files with 9 additions and 3 deletions
|
@ -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}")
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue