Win32 update

Add defines used in WIN32 and MSVC
This commit is contained in:
Bartosz Pajewski 2019-09-15 15:39:51 +02:00
parent 62d6c61bf4
commit 19f4df96b3
2 changed files with 19 additions and 4 deletions

View File

@ -11,6 +11,7 @@ SET(WIN32_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zxing/win32/zxing)
SET(ZXING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zxing/zxing)
set(CMAKE_AUTOMOC ON)
set(CMAKE_WARN_ON)
set(SOURCES
@ -39,8 +40,21 @@ endif(QZXING_USE_QML)
add_library(qzxing "" ${SOURCES})
add_subdirectory(zxing/bigint)
if(WIN32)
add_subdirectory(zxing/win32)
if(MSVC)
add_definitions(-D__STDC_LIMIT_MACROS)
endif(MSVC)
add_definitions(-DNO_ICONV)
endif(WIN32)
if(VS_WINRT_COMPONENT)
add_definitions(-DNO_ICONV)
endif(VS_WINRT_COMPONENT)
add_subdirectory(zxing/bigint)
add_subdirectory(zxing/zxing)
target_link_libraries(qzxing Qt5::Core Qt5::Gui)
@ -56,7 +70,6 @@ if(QZXING_USE_QML)
Qt5::QuickControls2)
endif(QZXING_USE_QML)
# Change Global Definitions depending on how you want to use the library
target_compile_definitions(qzxing PUBLIC DISABLE_LIBRARY_FEATURES)

View File

@ -4,8 +4,10 @@ SET(SOURCES
zxing/iconv.h
zxing/win_iconv.c
zxing/msvc/stdint.h
)
if(MSVC)
LIST(APPEND SOURCES zxing/msvc/stdint.h)
endif(MSVC)
target_sources(qzxing PRIVATE ${SOURCES})