Skip to content

Commit bec9e93

Browse files
committed
cmake: Set correct architecture (if specified) when configuring protobuf build.
1 parent 8a4f34e commit bec9e93

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cdk/cmake/DepFindProtobuf.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,19 @@ set(CONFIG_EXPR
8585
$<$<CONFIG:Static>:Release>$<$<NOT:$<CONFIG:Static>>:$<CONFIG>>
8686
)
8787

88+
set(set_arch)
89+
if(CMAKE_GENERATOR_PLATFORM)
90+
set(set_arch -A ${CMAKE_GENERATOR_PLATFORM})
91+
endif()
92+
8893
set(set_toolset)
8994
if(CMAKE_GENERATOR_TOOLSET)
9095
set(set_toolset -T ${CMAKE_GENERATOR_TOOLSET})
9196
endif()
9297

9398
if(NOT EXISTS "${PB_BINARY_DIR}/exports.cmake")
9499

95-
message("==== Configuring Protobuf build using cmake generator: ${CMAKE_GENERATOR}")
100+
message("==== Configuring Protobuf build using cmake generator: ${CMAKE_GENERATOR} ${set_arch} ${set_toolset}")
96101

97102
file(REMOVE "${PB_BINARY_DIR}/CMakeCache.txt")
98103
file(MAKE_DIRECTORY "${PB_BINARY_DIR}")
@@ -106,7 +111,8 @@ if(NOT EXISTS "${PB_BINARY_DIR}/exports.cmake")
106111
execute_process(
107112
COMMAND ${CMAKE_COMMAND}
108113
-G "${CMAKE_GENERATOR}"
109-
${set_toolset}
114+
${set_arch}
115+
${set_toolset}
110116
${set_build_type}
111117
-DSTATIC_MSVCRT=${STATIC_MSVCRT}
112118
-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}

0 commit comments

Comments
 (0)