Skip to content

Commit bd624d9

Browse files
Abseil Teamcopybara-github
authored andcommitted
fix(CMake): correct target variable for DLLs
The `_dll` variable contains the target name. The code was trying to use `_NAME` when handling ABSL_PROPAGATE_CXX_STD. Probably a cut&paste error from the other places where we handle that option. PiperOrigin-RevId: 510551097 Change-Id: I006435978333dd7a72a300503389a7bf48fb6d0d
1 parent d32a746 commit bd624d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMake/AbseilDll.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
789789
# Abseil libraries require C++14 as the current minimum standard. When
790790
# compiled with C++17 (either because it is the compiler's default or
791791
# explicitly requested), then Abseil requires C++17.
792-
_absl_target_compile_features_if_available(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
792+
_absl_target_compile_features_if_available(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
793793
else()
794794
# Note: This is legacy (before CMake 3.8) behavior. Setting the
795795
# target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is
@@ -799,8 +799,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
799799
# CXX_STANDARD_REQUIRED does guard against the top-level CMake project
800800
# not having enabled CMAKE_CXX_STANDARD_REQUIRED (which prevents
801801
# "decaying" to an older standard if the requested one isn't available).
802-
set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
803-
set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
802+
set_property(TARGET ${_dll} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
803+
set_property(TARGET ${_dll} PROPERTY CXX_STANDARD_REQUIRED ON)
804804
endif()
805805

806806
install(TARGETS ${_dll} EXPORT ${PROJECT_NAME}Targets

0 commit comments

Comments
 (0)