mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
cmake: fix issue building with rocksdb on multi-configs
Example error that occurred: ``` CMake Error in CMakeLists.txt: IMPORTED_LOCATION not set for imported target "RocksDB::rocksdb" configuration "MinSizeRel". ```
This commit is contained in:
@@ -335,9 +335,13 @@ if (WITH_ROCKSDB)
|
|||||||
# explicit mapping, RelWithDebInfo and MinSizeRel builds would end up linking the
|
# explicit mapping, RelWithDebInfo and MinSizeRel builds would end up linking the
|
||||||
# /MDd-flavored rocksdb_d.lib into an /MD (NDEBUG) binary, causing a CRT/runtime-library
|
# /MDd-flavored rocksdb_d.lib into an /MD (NDEBUG) binary, causing a CRT/runtime-library
|
||||||
# mismatch that depends on nothing but that alphabetical ordering.
|
# mismatch that depends on nothing but that alphabetical ordering.
|
||||||
|
#
|
||||||
|
# Important: we're mixing up MinSizeRel to RelWithDebInfo targets and vice versa, because
|
||||||
|
# multi-config builds always define targets for each config and it has to be able to find a fallback,
|
||||||
|
# otherwise configuration would fail.
|
||||||
set_target_properties(${IFCOPENSHELL_ROCKSDB_IMPORTED_TARGET} PROPERTIES
|
set_target_properties(${IFCOPENSHELL_ROCKSDB_IMPORTED_TARGET} PROPERTIES
|
||||||
MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RELWITHDEBINFO;RELEASE"
|
MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RELWITHDEBINFO;RELEASE;MINSIZEREL"
|
||||||
MAP_IMPORTED_CONFIG_MINSIZEREL "MINSIZEREL;RELEASE"
|
MAP_IMPORTED_CONFIG_MINSIZEREL "MINSIZEREL;RELEASE;RELWITHDEBINFO"
|
||||||
)
|
)
|
||||||
target_link_libraries(IFCOPENSHELL_RocksDB INTERFACE ${IFCOPENSHELL_ROCKSDB_IMPORTED_TARGET})
|
target_link_libraries(IFCOPENSHELL_RocksDB INTERFACE ${IFCOPENSHELL_ROCKSDB_IMPORTED_TARGET})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user