diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a13564..96df5ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14) set(VERSION "0.4.1") -project(cpuid LANGUAGES C CXX ASM VERSION ${VERSION}) +project(cpuid LANGUAGES C CXX ASM_MASM VERSION ${VERSION}) set(CMAKE_CXX_STANDARD 11) set(CMAKE_C_STANDARD 99) diff --git a/libcpuid/CMakeLists.txt b/libcpuid/CMakeLists.txt index 48cadd6..96533ac 100644 --- a/libcpuid/CMakeLists.txt +++ b/libcpuid/CMakeLists.txt @@ -1,12 +1,18 @@ +set(cpuid_sources cpuid_main.c + recog_intel.c + recog_amd.c + rdtsc.c + libcpuid_util.c + rdmsr.c + msrdriver.c + asm-bits.c) + +if ("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64") + list(APPEND cpuid_sources masm-x64.asm) +endif () + add_library(cpuid - cpuid_main.c - recog_intel.c - recog_amd.c - rdtsc.c - asm-bits.c - libcpuid_util.c - rdmsr.c - msrdriver.c + ${cpuid_sources} ) target_include_directories(cpuid SYSTEM PUBLIC $)