Skip to content

Commit

Permalink
Debug and release use the same files
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed Sep 21, 2017
1 parent 7136548 commit f7e26fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
25 changes: 18 additions & 7 deletions PDFiumConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,31 @@ if(NOT MSVC)
endif()

if(CMAKE_CL_64)
set(PDFium_ARCH x64)
set(PDFium_ARCH x64)
else()
set(PDFium_ARCH x86)
set(PDFium_ARCH x86)
endif()

if(NOT PDFium_FIND_QUIETLY)
message(STATUS "PDFium ARCH: ${PDFium_ARCH}")
endif()

add_library(pdfium STATIC IMPORTED)
set(PDFium_BIN_PATH "${CMAKE_CURRENT_LIST_DIR}/${PDFium_ARCH}/bin")
set(PDFium_LIB_PATH "${CMAKE_CURRENT_LIST_DIR}/${PDFium_ARCH}/lib")
set(PDFium_INCLUDE_PATH "${CMAKE_CURRENT_LIST_DIR}/include")

add_library(pdfium SHARED IMPORTED)
set_target_properties(pdfium
PROPERTIES
IMPORTED_LOCATION "C:\\Libraries\\pdfium\\${PDFium_ARCH}\\vs15\\lib\\pdfium.lib"
IMPORTED_LOCATION_DEBUG "C:\\Libraries\\pdfium\\${PDFium_ARCH}\\vs15\\lib\\pdfiumd.lib"
INTERFACE_INCLUDE_DIRECTORIES "C:\\Libraries\\pdfium\\include"
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "-ignore:4099"
IMPORTED_LOCATION "${PDFium_BIN_PATH}/pdfium.dll"
IMPORTED_IMPLIB "${PDFium_LIB_PATH}/pdfium.dll.lib"
INTERFACE_INCLUDE_DIRECTORIES "${PDFium_INCLUDE_PATH}"
)

file(TO_NATIVE_PATH "${PDFium_BIN_PATH}" PDFium_BIN_PATH)
file(TO_NATIVE_PATH "${PDFium_LIB_PATH}" PDFium_LIB_PATH)

if(NOT PDFium_FIND_QUIETLY)
message(STATUS "Found PDFium in ${PDFium_LIB_PATH}")
message(STATUS "You may need to add ${PDFium_BIN_PATH} to the PATH.")
endif()
11 changes: 3 additions & 8 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@ set PDFium_CMAKE_CONFIG=%CD%\PDFiumConfig.cmake
set PDFium_ARGS=%CD%\args.gn

: Output
set PDFium_NAME=pdfium
if "%CONFIGURATION%"=="Debug" set PDFium_NAME=pdfiumd
set PDFium_STAGING_DIR=%CD%\staging
set PDFium_INCLUDE_DIR=%PDFium_STAGING_DIR%\include
set PDFium_BIN_DIR=%PDFium_STAGING_DIR%\%PLATFORM%\bin
set PDFium_DLL_FILE=%PDFium_BIN_DIR%\%PDFium_NAME%.dll
set PDFium_PDB_FILE=%PDFium_BIN_DIR%\%PDFium_NAME%.pdb
set PDFium_LIB_DIR=%PDFium_STAGING_DIR%\%PLATFORM%\lib
set PDFium_LIB_FILE=%PDFium_LIB_DIR%\%PDFium_NAME%.lib
set PDFium_ARTIFACT=%CD%\pdfium-%PLATFORM%.zip
if "%CONFIGURATION%"=="Debug" set PDFium_ARTIFACT=%CD%\pdfium-%PLATFORM%-debug.zip

Expand Down Expand Up @@ -66,9 +61,9 @@ move %PDFium_SOURCE_DIR%\LICENSE %PDFium_STAGING_DIR%
move %PDFium_SOURCE_DIR%\public %PDFium_INCLUDE_DIR%
del %PDFium_INCLUDE_DIR%\DEPS
del %PDFium_INCLUDE_DIR%\README
move %PDFium_BUILD_DIR%\pdfium.dll.lib %PDFium_LIB_FILE%
move %PDFium_BUILD_DIR%\pdfium.dll %PDFium_DLL_FILE%
if "%CONFIGURATION%"=="Debug" move %PDFium_BUILD_DIR%\pdfium.dll.pdb %PDFium_PDB_FILE%
move %PDFium_BUILD_DIR%\pdfium.dll.lib %PDFium_LIB_DiR%
move %PDFium_BUILD_DIR%\pdfium.dll %PDFium_BIN_DIR%
if "%CONFIGURATION%"=="Debug" move %PDFium_BUILD_DIR%\pdfium.dll.pdb %PDFium_BIN_DIR%
cd %PDFium_STAGING_DIR%

: Pack
Expand Down

0 comments on commit f7e26fa

Please sign in to comment.