Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
Adjust cmake scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
stdrc committed Jan 14, 2019
1 parent 484bbe6 commit 92d7622
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}") # build with object level paralle
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

include(cotire)
include(UseStaticCRT)
include(FindVcpkgIncludeDir)

if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
# fix Vcpkg debug library lookup bug, see https://github.com/Microsoft/vcpkg/issues/1626
list(APPEND CMAKE_IGNORE_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib)
endif()
include(FixDebugLibraryLookup)

include_directories(${VCPKG_INCLUDE_DIR})
include_directories(src)
Expand All @@ -26,6 +21,8 @@ add_definitions(-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE

find_package(Iconv REQUIRED)

include(FixLinkConflict)

file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
set(LIB_NAME "com.example.demo")
add_library(${LIB_NAME} SHARED ${SOURCE_FILES})
Expand Down
4 changes: 4 additions & 0 deletions cmake/Modules/FixDebugLibraryLookup.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
# fix Vcpkg debug library lookup bug, see https://github.com/Microsoft/vcpkg/issues/1626
list(APPEND CMAKE_IGNORE_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib)
endif()
7 changes: 0 additions & 7 deletions cmake/Modules/UseStaticCRT.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/x86-windows-static-custom.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v141)

0 comments on commit 92d7622

Please sign in to comment.