build: Prevent the redefinition of stdlib_pch target in release builds
```
-- Precompiled headers were enabled
CMake Error at build-support/macros-and-definitions.cmake:1272 (add_library):
add_library cannot create ALIAS target "stdlib_pch" because another target
with the same name already exists.
Call Stack (most recent call first):
CMakeLists.txt:149 (process_options)
```
Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
@@ -1297,7 +1297,11 @@ macro(process_options)
|
||||
stdlib_pch${build_profile_suffix} PUBLIC
|
||||
"${precompiled_header_libraries}"
|
||||
)
|
||||
add_library(stdlib_pch ALIAS stdlib_pch${build_profile_suffix})
|
||||
|
||||
# Alias may collide with actual pch in builds without suffix (e.g. release)
|
||||
if(NOT TARGET stdlib_pch)
|
||||
add_library(stdlib_pch ALIAS stdlib_pch${build_profile_suffix})
|
||||
endif()
|
||||
|
||||
add_executable(
|
||||
stdlib_pch_exec ${PROJECT_SOURCE_DIR}/build-support/empty-main.cc
|
||||
|
||||
Reference in New Issue
Block a user