Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(plutosvg PUBLIC PLUTOSVG_BUILD_STATIC)
endif()

if(MSVC OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
target_compile_definitions(plutosvg PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()

option(PLUTOSVG_ENABLE_FREETYPE "Enable Freetype integration" OFF)
if(PLUTOSVG_ENABLE_FREETYPE)
find_package(Freetype 2.12 REQUIRED)
Expand Down
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if math_dep.found()
plutosvg_deps += [math_dep]
endif

if cc.get_id() == 'msvc' or cc.get_id() == 'clang' or cc.get_id() == 'clang-cl'
plutovg_c_args += ['-D_CRT_SECURE_NO_WARNINGS']
endif

freetype_dep = dependency('freetype2',
required: get_option('freetype'),
version: '>=2.12',
Expand Down
9 changes: 9 additions & 0 deletions source/plutosvg-ft.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
#ifndef PLUTOSVG_FT_H
#define PLUTOSVG_FT_H

#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif

#include "plutosvg.h"

#include <stdlib.h>
Expand Down Expand Up @@ -289,4 +294,8 @@ static SVG_RendererHooks plutosvg_ft_hooks = {
(SVG_Lib_Preset_Slot_Func)plutosvg_ft_preset_slot
};

#if _MSC_VER
#pragma warning(pop)
#endif

#endif // PLUTOSVG_FT_H
Loading