mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
cmake: Use OBJECT target instead of STATIC one to avoid mix static and shared targets in a same build
This commit is contained in:
committed by
Andrej730
parent
37d29e5d47
commit
8fb10d2ff3
@@ -595,13 +595,13 @@ if(BUILD_CONVERT OR BUILD_IFCPYTHON)
|
|||||||
foreach(schema ${SCHEMA_VERSIONS})
|
foreach(schema ${SCHEMA_VERSIONS})
|
||||||
set(GEOM_SERIALIZER_SCHEMA_LIBRARIES ${GEOM_SERIALIZER_SCHEMA_LIBRARIES} GeometrySerializers_ifc${schema})
|
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}")
|
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})
|
target_link_libraries(geometry_serializer_ifc${schema} ${OpenCASCADE_LIBRARIES})
|
||||||
list(APPEND geometry_serializer_libraries geometry_serializer_ifc${schema})
|
list(APPEND geometry_serializer_libraries geometry_serializer_ifc${schema})
|
||||||
endforeach()
|
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")
|
set_target_properties(geometry_serializer PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS")
|
||||||
target_link_libraries(geometry_serializer ${geometry_serializer_libraries} IfcParse)
|
target_link_libraries(geometry_serializer ${geometry_serializer_libraries} IfcParse)
|
||||||
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} geometry_serializer ${geometry_serializer_libraries})
|
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)
|
file(GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/mapping/*.cpp)
|
||||||
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES})
|
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}")
|
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
|
||||||
target_link_libraries(geometry_mapping_ifc${schema} IfcParse)
|
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})
|
list(APPEND mapping_libraries geometry_mapping_ifc${schema})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ file(GLOB SERIALIZERS_S_CPP_FILES *.cpp)
|
|||||||
set(SERIALIZERS_S_FILES ${SERIALIZERS_S_H_FILES} ${SERIALIZERS_S_CPP_FILES})
|
set(SERIALIZERS_S_FILES ${SERIALIZERS_S_H_FILES} ${SERIALIZERS_S_CPP_FILES})
|
||||||
|
|
||||||
foreach(schema ${SCHEMA_VERSIONS})
|
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(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} Serializers_ifc${schema})
|
||||||
set_target_properties(Serializers_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
|
set_target_properties(Serializers_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
|
||||||
if(WASM_BUILD)
|
if(WASM_BUILD)
|
||||||
|
|||||||
Reference in New Issue
Block a user