Commit 58507650 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

set -fvisibility=hidden

parent 2efd31bf
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -79,19 +79,19 @@ 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} m)
set(FVIZ_LIB_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})
target_link_libraries(fviz-lib-so ${FVIZ_LIB_LDFLAGS})
set_target_properties(fviz-lib-so PROPERTIES OUTPUT_NAME fviz)
set_target_properties(fviz-lib-so PROPERTIES PUBLIC_HEADER "core/api.h")

set_target_properties(fviz-lib-so PROPERTIES CXX_VISIBILITY_PRESET hidden)

# Build: CLI
# -----------------------------------------------------------------------------
add_executable(fviz-cli "core/cli.cc" $<TARGET_OBJECTS:fviz>)
target_link_libraries(fviz-cli ${fviz_LDFLAGS})
target_link_libraries(fviz-cli ${FVIZ_LIB_LDFLAGS})
set_target_properties(fviz-cli PROPERTIES OUTPUT_NAME fviz)


@@ -116,7 +116,7 @@ foreach(unit_test_path ${unit_test_files})
  get_filename_component(unit_test_srcdir ${unit_test_path} DIRECTORY)

  add_executable(${unit_test_name} ${unit_test_path} $<TARGET_OBJECTS:fviz>)
  target_link_libraries(${unit_test_name} ${fviz_LDFLAGS})
  target_link_libraries(${unit_test_name} ${FVIZ_LIB_LDFLAGS})

  add_test(
      NAME test-unit-${unit_test_name}
+8 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
extern "C" {
#endif

#define FVIZ_API __attribute__((visibility ("default")))

typedef struct fviz_s fviz_t;

/**
@@ -28,17 +30,20 @@ typedef struct fviz_s fviz_t;
 *
 * @returns: A fviz context that must be free'd using `fviz_destroy`
 */
FVIZ_API
fviz_t* fviz_init();

/**
 * Free a fviz context
 */
FVIZ_API
void fviz_destroy(fviz_t* ctx);

/**
 * Retrieve the last error message. The returned pointer is valid until the next
 * `fviz_*` method is called on the context.
 */
FVIZ_API
const char* fviz_get_error(const fviz_t* ctx);

/**
@@ -46,16 +51,19 @@ const char* fviz_get_error(const fviz_t* ctx);
 *
 * @returns: One (1) on success and zero (0) if an error has occured
 */
FVIZ_API
int fviz_eval(fviz_t* ctx, const char* expr);

/**
 * Retrieve the result. Pointer is valid until the next call to fviz_eval
 */
FVIZ_API
void fviz_get_result(fviz_t* ctx, const void** data, size_t* data_len);

/**
 * Set the output format
 */
FVIZ_API
void fviz_set_output_format(fviz_t* ctx, const char* format);