summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt6
-rw-r--r--src/common/stb.cpp8
-rw-r--r--src/common/stb.h8
3 files changed, 21 insertions, 1 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 8a1861051..e216eb3de 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -120,6 +120,8 @@ add_library(common STATIC
120 socket_types.h 120 socket_types.h
121 spin_lock.cpp 121 spin_lock.cpp
122 spin_lock.h 122 spin_lock.h
123 stb.cpp
124 stb.h
123 steady_clock.cpp 125 steady_clock.cpp
124 steady_clock.h 126 steady_clock.h
125 stream.cpp 127 stream.cpp
@@ -208,6 +210,8 @@ if (MSVC)
208 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data 210 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
209 /we4800 # Implicit conversion from 'type' to bool. Possible information loss 211 /we4800 # Implicit conversion from 'type' to bool. Possible information loss
210 ) 212 )
213else()
214 set_source_files_properties(stb.cpp PROPERTIES COMPILE_OPTIONS "-Wno-implicit-fallthrough;-Wno-missing-declarations;-Wno-missing-field-initializers")
211endif() 215endif()
212 216
213if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 217if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@@ -223,7 +227,7 @@ endif()
223 227
224create_target_directory_groups(common) 228create_target_directory_groups(common)
225 229
226target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile Threads::Threads) 230target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile stb::headers Threads::Threads)
227target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle) 231target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
228 232
229if (ANDROID) 233if (ANDROID)
diff --git a/src/common/stb.cpp b/src/common/stb.cpp
new file mode 100644
index 000000000..d3b16665d
--- /dev/null
+++ b/src/common/stb.cpp
@@ -0,0 +1,8 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#define STB_IMAGE_IMPLEMENTATION
5#define STB_IMAGE_RESIZE_IMPLEMENTATION
6#define STB_IMAGE_WRITE_IMPLEMENTATION
7
8#include "common/stb.h"
diff --git a/src/common/stb.h b/src/common/stb.h
new file mode 100644
index 000000000..e5c197c11
--- /dev/null
+++ b/src/common/stb.h
@@ -0,0 +1,8 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <stb_image.h>
7#include <stb_image_resize.h>
8#include <stb_image_write.h>