Commit 854a37bb authored by Paul Asmuth's avatar Paul Asmuth Committed by Paul Asmuth
Browse files

fix build on macos 10.14

parent a487d969
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -25,7 +25,9 @@ find_package(PNG)
  find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h)
  find_library(FRIBIDI_LIBRARY NAMES fribidi)

  if(NOT FRIBIDI_FOUND)
  if(FRIBIDI_FOUND)
    set(FRIBIDI_LIBRARIES "${FRIBIDI_LIBRARY}")
  else()
    message(WARNING "libfribidi not found; disabling BiDI support")
    set(FVIZ_TEXT_ENABLE_BIDI OFF)
  endif()
@@ -35,8 +37,6 @@ find_package(PNG)
# Compile Flags
# -----------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")

include_directories(${CAIRO_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core/utils)
@@ -79,10 +79,11 @@ file(GLOB source_files "core/*.cc" "core/**/*.cc" "elements/*.cc" "elements/**/*
list(REMOVE_ITEM source_files "${CMAKE_SOURCE_DIR}/core/cli.cc")
add_library(fviz OBJECT ${source_files})
set_property(TARGET fviz PROPERTY POSITION_INDEPENDENT_CODE 1)
set(fviz_LDFLAGS ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${FRIBIDI_LIBRARIES} fmt)
set(fviz_LDFLAGS ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${FRIBIDI_LIBRARIES} m)
add_library(fviz-lib-a STATIC $<TARGET_OBJECTS:fviz>)
set_target_properties(fviz-lib-a PROPERTIES OUTPUT_NAME fviz)
add_library(fviz-lib-so SHARED $<TARGET_OBJECTS:fviz>)
target_link_libraries(fviz-lib-so ${fviz_LDFLAGS})
set_target_properties(fviz-lib-so PROPERTIES OUTPUT_NAME fviz)
set_target_properties(fviz-lib-so PROPERTIES PUBLIC_HEADER "core/api.h")

+2 −2
Original line number Diff line number Diff line
@@ -61,12 +61,12 @@ int fviz_set_output_format(fviz_t* ctx, const char* path, const char* fmt) {
  std::string format = fmt;

  if (format == "svg") {
    ctx->format == OutputFormat::SVG;
    ctx->format = OutputFormat::SVG;
    return OK;
  }

  if (format == "png") {
    ctx->format == OutputFormat::PNG;
    ctx->format = OutputFormat::PNG;
    return OK;
  }

+2 −0
Original line number Diff line number Diff line
@@ -12,8 +12,10 @@
 * limitations under the License.
 */
#include "arrows.h"
#include <functional>

using namespace std::placeholders;
using std::bind;

namespace fviz {

+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <functional>

using namespace std::placeholders;
using std::bind;

namespace fviz {

+3 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include FT_GLYPH_H

using namespace std::placeholders;
using std::bind;

namespace fviz {

@@ -83,7 +84,6 @@ ReturnCode font_get_glyph_path(

  auto glyph_outline = &((FT_OutlineGlyph) glyph)->outline;


  // retrieve the glyph outline data from freetype
  enum class GlyphPointType { MOVE, SIMPLE, CONTROL };

@@ -124,6 +124,8 @@ ReturnCode font_get_glyph_path(
    }
  }

  FT_Done_Glyph(glyph);

  // convert the glyph outline to a path object
  *path = Path{};

Loading