Skip to content

Commit 8c2c4cf

Browse files
committed
Update abseil
For test_c_interface_shared, avoid linking against effcee. Linking effcee pulls in abseil, which will have been compiled with conflicting C++ Runtime options (shared vs. static).
1 parent 4c2ec2a commit 8c2c4cf

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use_relative_paths = True
33
vars = {
44
'github': 'https://github.com',
55

6-
'abseil_revision': '351086314d46e73d430296c9eca1f6d6c0372cd1',
6+
'abseil_revision': '7dcc24cf19674efc75b8e8de06b9617838b8e0e9',
77

88
'effcee_revision': 'ae38e040cbb7e83efa8bfbb4967e5b8c8c89b55a',
99

test/CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ endif()
2626
# Add a SPIR-V Tools unit test. Signature:
2727
# add_spvtools_unittest(
2828
# TARGET target_name
29+
# SKIP_EFFCEE ON # optional
2930
# SRCS src_file.h src_file.cpp
3031
# LIBS lib1 lib2
3132
# )
3233
function(add_spvtools_unittest)
3334
if (NOT "${SPIRV_SKIP_TESTS}" AND TARGET gmock_main)
34-
set(one_value_args TARGET PCH_FILE)
35+
set(one_value_args TARGET PCH_FILE SKIP_EFFCEE)
3536
set(multi_value_args SRCS LIBS ENVIRONMENT DEFINES)
3637
cmake_parse_arguments(
3738
ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN})
@@ -68,13 +69,14 @@ function(add_spvtools_unittest)
6869
${gtest_SOURCE_DIR}/include
6970
${gmock_SOURCE_DIR}/include
7071
)
71-
if (TARGET effcee)
72-
# If using Effcee for testing, then add its include directory.
73-
target_include_directories(${target} PRIVATE ${effcee_SOURCE_DIR})
74-
endif()
7572
target_link_libraries(${target} PRIVATE ${ARG_LIBS})
7673
if (TARGET effcee)
77-
target_link_libraries(${target} PRIVATE effcee)
74+
if ("${ARG_SKIP_EFFCEE}")
75+
else()
76+
# If using Effcee for testing, then add its include directory.
77+
target_include_directories(${target} PRIVATE ${effcee_SOURCE_DIR})
78+
target_link_libraries(${target} PRIVATE effcee)
79+
endif()
7880
endif()
7981
target_link_libraries(${target} PRIVATE gmock_main)
8082
add_test(NAME spirv-tools-${target} COMMAND ${target})
@@ -174,11 +176,17 @@ add_spvtools_unittest(
174176

175177
add_spvtools_unittest(
176178
TARGET c_interface
179+
SKIP_EFFCEE ON
177180
SRCS c_interface_test.cpp
178181
LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
179182

180183
add_spvtools_unittest(
181184
TARGET c_interface_shared
185+
# Effcee pulls in Abseil. But if the executable is compiled
186+
# with the shared C++ runtime, then Abseil also needs the shared
187+
# C++ runtime. Skip linking effcee to avoid the problem in the
188+
# first place. The C interface test doesn't need it.
189+
SKIP_EFFCEE ON
182190
SRCS c_interface_test.cpp
183191
LIBS ${SPIRV_TOOLS}-shared
184192
ENVIRONMENT PATH=$<TARGET_FILE_DIR:${SPIRV_TOOLS}-shared>)

0 commit comments

Comments
 (0)