diff --git a/Makefile b/Makefile index ca5cd32a4..15391f279 100644 --- a/Makefile +++ b/Makefile @@ -302,17 +302,19 @@ mysql: ${MYSQL} libhl sqlite: ${SQLITE} libhl ${CC} ${CFLAGS} -shared -o sqlite.hdll ${SQLITE} ${LIBFLAGS} -L. -lhl -lsqlite3 +CXXFLAGS:=$(filter-out -std=c11,$(CFLAGS)) -std=c++11 + ./include/mikktspace/%.o: ./include/mikktspace/%.c ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} ./include/meshoptimizer/%.o: ./include/meshoptimizer/%.cpp - ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} + ${CC} ${CXXFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} ./libs/heaps/%.o: ./libs/heaps/%.c ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} ./libs/heaps/%.o: ./libs/heaps/%.cpp - ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} + ${CC} ${CXXFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} heaps: ${HEAPS} libhl ${CC} ${CFLAGS} ${HEAPS_CFLAGS} -shared -o heaps.hdll ${HEAPS} ${LIBFLAGS} -L. -lhl diff --git a/libs/heaps/CMakeLists.txt b/libs/heaps/CMakeLists.txt new file mode 100644 index 000000000..42ae82d1b --- /dev/null +++ b/libs/heaps/CMakeLists.txt @@ -0,0 +1,46 @@ +set(HEAPS_INCLUDE_DIRS + ${INCLUDES_BASE_DIR}/mikktspace + ${INCLUDES_BASE_DIR}/meshoptimizer + ${INCLUDES_BASE_DIR}/vhacd + . +) + +add_library(heaps.hdll SHARED + ${INCLUDES_BASE_DIR}/mikktspace/mikktspace.c + ${INCLUDES_BASE_DIR}/meshoptimizer/allocator.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/overdrawoptimizer.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/vcacheoptimizer.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/clusterizer.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/quantization.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/vertexcodec.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/indexcodec.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/simplifier.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/vertexfilter.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/indexgenerator.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/spatialorder.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/vfetchanalyzer.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/stripifier.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/vfetchoptimizer.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/overdrawanalyzer.cpp + ${INCLUDES_BASE_DIR}/meshoptimizer/vcacheanalyzer.cpp + mikkt.c + meshoptimizer.cpp + vhacd.cpp +) + +set_as_hdll(heaps) + +target_include_directories(heaps.hdll + PRIVATE + ${HEAPS_INCLUDE_DIRS} +) + +target_link_libraries(heaps.hdll + libhl +) + +install( + TARGETS + heaps.hdll + DESTINATION ${HDLL_DESTINATION} +)