diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index ed9487c6fc..a594dedf23 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -595,13 +595,13 @@ if(BUILD_CONVERT OR BUILD_IFCPYTHON) foreach(schema ${SCHEMA_VERSIONS}) set(GEOM_SERIALIZER_SCHEMA_LIBRARIES ${GEOM_SERIALIZER_SCHEMA_LIBRARIES} GeometrySerializers_ifc${schema}) - add_library(geometry_serializer_ifc${schema} STATIC ../src/ifcgeom/Serialization/schema/Serialization.cpp) + add_library(geometry_serializer_ifc${schema} OBJECT ../src/ifcgeom/Serialization/schema/Serialization.cpp) set_target_properties(geometry_serializer_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS -DIfcSchema=Ifc${schema}") target_link_libraries(geometry_serializer_ifc${schema} ${OpenCASCADE_LIBRARIES}) list(APPEND geometry_serializer_libraries geometry_serializer_ifc${schema}) endforeach() - add_library(geometry_serializer STATIC ../src/ifcgeom/Serialization/Serialization.h ../src/ifcgeom/Serialization/Serialization.cpp) + add_library(geometry_serializer OBJECT ../src/ifcgeom/Serialization/Serialization.h ../src/ifcgeom/Serialization/Serialization.cpp) set_target_properties(geometry_serializer PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS") target_link_libraries(geometry_serializer ${geometry_serializer_libraries} IfcParse) set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} geometry_serializer ${geometry_serializer_libraries}) @@ -636,12 +636,9 @@ if(BUILD_IFCGEOM) file(GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/mapping/*.cpp) set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES}) - add_library(geometry_mapping_ifc${schema} STATIC ${IFCGEOM_FILES}) + add_library(geometry_mapping_ifc${schema} OBJECT ${IFCGEOM_FILES}) set_target_properties(geometry_mapping_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}") target_link_libraries(geometry_mapping_ifc${schema} IfcParse) - if (NOT BUILD_SHARED_LIBS) - target_link_libraries(geometry_mapping_ifc${schema} IfcGeom) - endif() list(APPEND mapping_libraries geometry_mapping_ifc${schema}) endforeach() diff --git a/src/serializers/schema_dependent/CMakeLists.txt b/src/serializers/schema_dependent/CMakeLists.txt index 55910ca153..40f17d283d 100644 --- a/src/serializers/schema_dependent/CMakeLists.txt +++ b/src/serializers/schema_dependent/CMakeLists.txt @@ -3,7 +3,7 @@ file(GLOB SERIALIZERS_S_CPP_FILES *.cpp) set(SERIALIZERS_S_FILES ${SERIALIZERS_S_H_FILES} ${SERIALIZERS_S_CPP_FILES}) foreach(schema ${SCHEMA_VERSIONS}) - add_library(Serializers_ifc${schema} STATIC ${SERIALIZERS_S_FILES}) + add_library(Serializers_ifc${schema} OBJECT ${SERIALIZERS_S_FILES}) set(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} Serializers_ifc${schema}) set_target_properties(Serializers_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}") if(WASM_BUILD)