cmake - fix ifc geom mapping not linking against IfcGeom library

This commit is contained in:
Andrej730
2026-02-20 14:40:37 +05:00
parent fc13bcd055
commit 5b86eedb26
+10 -1
View File
@@ -1,12 +1,21 @@
find_package(Eigen3 REQUIRED)
# When using `ENABLE_BUILD_OPTIMIZATIONS``/GL` compilation flags makes resulting mapping libs huge (e.g. 1.5GB each)
# and combining them together to a single IfcGeom won't be possible due to 4GB file size limit.
# So in this case we have to ensure each mapping is built as separate libs instead of .obj files to be linked together.
if(ENABLE_BUILD_OPTIMIZATIONS AND MSVC)
set(mapping_library_type "STATIC")
else()
set(mapping_library_type "OBJECT")
endif()
foreach(schema ${SCHEMA_VERSIONS})
file(GLOB IFCGEOM_I_FILES *.i)
file(GLOB IFCGEOM_H_FILES *.h)
file(GLOB IFCGEOM_CPP_FILES *.cpp)
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES})
add_library(geometry_mapping_ifc${schema} OBJECT ${IFCGEOM_FILES})
add_library(geometry_mapping_ifc${schema} ${mapping_library_type} ${IFCGEOM_FILES})
set_target_properties(
geometry_mapping_ifc${schema}
PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}"