Modules: Fix per-language fallback to platform-specific shared module C flags

On platforms that semantically distinguish loadable modules (plugins)
from shared libraries, such as macOS and CYGWIN, fix the per-language
fall back to create them the same way as with the C toolchain even when
the C language has not been enabled.
This commit is contained in:
Brad King
2024-05-16 10:51:19 -04:00
parent ae1d5ef47f
commit 0b24c94676

View File

@@ -104,10 +104,10 @@ macro(_cmake_common_language_platform_flags lang)
endif()
if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS)
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
endif()
if(NOT DEFINED CMAKE_SHARED_MODULE_${lang}_FLAGS)
set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif()
foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)