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

Commit 92d7622

Browse files
committed
Adjust cmake scripts
1 parent 484bbe6 commit 92d7622

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}") # build with object level paralle
88
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
99

1010
include(cotire)
11-
include(UseStaticCRT)
1211
include(FindVcpkgIncludeDir)
13-
14-
if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
15-
# fix Vcpkg debug library lookup bug, see https://github.com/Microsoft/vcpkg/issues/1626
16-
list(APPEND CMAKE_IGNORE_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib)
17-
endif()
12+
include(FixDebugLibraryLookup)
1813

1914
include_directories(${VCPKG_INCLUDE_DIR})
2015
include_directories(src)
@@ -26,6 +21,8 @@ add_definitions(-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
2621

2722
find_package(Iconv REQUIRED)
2823

24+
include(FixLinkConflict)
25+
2926
file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
3027
set(LIB_NAME "com.example.demo")
3128
add_library(${LIB_NAME} SHARED ${SOURCE_FILES})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
2+
# fix Vcpkg debug library lookup bug, see https://github.com/Microsoft/vcpkg/issues/1626
3+
list(APPEND CMAKE_IGNORE_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib)
4+
endif()

cmake/Modules/UseStaticCRT.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
set(VCPKG_TARGET_ARCHITECTURE x86)
2-
set(VCPKG_CRT_LINKAGE static)
2+
set(VCPKG_CRT_LINKAGE dynamic)
33
set(VCPKG_LIBRARY_LINKAGE static)
44
set(VCPKG_PLATFORM_TOOLSET v141)

0 commit comments

Comments
 (0)