Skip to content

Commit deebf37

Browse files
committed
don't set VCPKG_DEFAULT_TRIPLET or VCPKG_TARGET_TRIPLET
1 parent 0b5a45d commit deebf37

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.github/workflows/cmake-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ jobs:
6464
compiler: g++
6565
env:
6666
CXX: ${{ matrix.compiler }}
67-
VCPKG_DEFAULT_TRIPLET: ${{ matrix.target-cpu }}-${{ matrix.target-os }}-static
6867
VCPKG_DISABLE_METRICS: true
6968
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
7069
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/.cache

CMakeLists.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,26 @@ endif()
1313
if(NOT VCPKG_ROOT)
1414
set(VCPKG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg")
1515
endif()
16-
# if (LINUX)
17-
# set(VCPKG_CRT_LINKAGE static)
18-
# set(VCPKG_LIBRARY_LINKAGE static)
19-
# else()
20-
# set(VCPKG_CRT_LINKAGE dynamic)
21-
# set(VCPKG_LIBRARY_LINKAGE dynamic)
16+
# if(NOT VCPKG_DEFAULT_TRIPLET)
17+
# set(VCPKG_DEFAULT_TRIPLET $ENV{VCPKG_DEFAULT_TRIPLET})
18+
# endif()
19+
# if(NOT VCPKG_TARGET_TRIPLET)
20+
# set(VCPKG_TARGET_TRIPLET $ENV{VCPKG_TARGET_TRIPLET})
2221
# endif()
22+
# if(NOT VCPKG_TARGET_TRIPLET)
23+
# set(VCPKG_TARGET_TRIPLET ${VCPKG_DEFAULT_TRIPLET})
24+
# endif()
25+
message("VCPKG_DEFAULT_TRIPLET = ${VCPKG_DEFAULT_TRIPLET}")
26+
if (NOT APPLE)
27+
set(VCPKG_CRT_LINKAGE static)
28+
set(VCPKG_LIBRARY_LINKAGE static)
29+
endif()
2330
set(VCPKG_BUILD_TYPE release)
2431
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
2532
CACHE STRING "Vcpkg toolchain file")
2633

2734
if(WIN32)
2835
set(BUILD_SHARED_LIBS OFF)
29-
# set(VCPKG_LIBRARY_LINKAGE static)
30-
# FIX: unsure if this matters but doesn't break things on arm64
31-
# set(VCPKG_TARGET_TRIPLET x64-windows-static)
32-
# FIX: this should be equivalent to x64-windows-static - why does it work on arm64?
33-
# message("CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
34-
# set(VCPKG_TARGET_ARCHITECTURE x64)
35-
# set(VCPKG_CRT_LINKAGE static)
36-
# set(VCPKG_LIBRARY_LINKAGE static)
3736
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
3837

3938
# # Enable Hot Reload for MSVC compilers if supported.

0 commit comments

Comments
 (0)