1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-02-02 20:14:07 +00:00

Don't link with msrdriver.c on non-Windows platform. (#159)

This simplify the procedure of sanitizing unneeded blob in source.
This commit is contained in:
Zhu Zihao 2022-01-14 16:35:10 +08:00 committed by GitHub
parent 7a580fd2b2
commit 2e61160983
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -56,6 +56,17 @@ if test "x$GCC" = "xyes"; then
AM_LDFLAGS="$AM_LDFLAGS -g -Wall" AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
fi fi
AC_CANONICAL_HOST
build_windows=no
case "${host_os}" in
cygwin*|mingw*)
build_windows=yes
;;
esac
AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_LDFLAGS) AC_SUBST(AM_LDFLAGS)

View file

@ -5,9 +5,12 @@ set(cpuid_sources
rdtsc.c rdtsc.c
libcpuid_util.c libcpuid_util.c
rdmsr.c rdmsr.c
msrdriver.c
asm-bits.c) asm-bits.c)
if(WIN32)
list(APPEND cpuid_sources msrdriver.c)
endif()
if("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64") if("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64")
list(APPEND cpuid_sources masm-x64.asm) list(APPEND cpuid_sources masm-x64.asm)
endif() endif()

View file

@ -13,8 +13,11 @@ libcpuid_la_SOURCES = \
rdtsc.c \ rdtsc.c \
asm-bits.c \ asm-bits.c \
libcpuid_util.c \ libcpuid_util.c \
rdmsr.c \ rdmsr.c
msrdriver.c
if WINDOWS
libcpuid_la_SOURCES += msrdriver.c
endif
libcpuid_la_DEPENDENCIES = \ libcpuid_la_DEPENDENCIES = \
$(srcdir)/libcpuid.sym $(srcdir)/libcpuid.sym