Skip to content

Commit 10b84fd

Browse files
committed
windows: fix static builds, by some define magic
1 parent d648a45 commit 10b84fd

File tree

7 files changed

+19
-3
lines changed

7 files changed

+19
-3
lines changed

src/helper/windows.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#if defined(_MSC_VER)
4+
#if defined(OOPETRIS_LIBRARY_GRAPHICS_COMPILATION)
45
#if defined(OOPETRIS_LIBRARY_GRAPHICS_EXPORT)
56
#define OOPETRIS_GRAPHICS_EXPORTED __declspec(dllexport)
67
#else
@@ -9,3 +10,6 @@
910
#else
1011
#define OOPETRIS_GRAPHICS_EXPORTED
1112
#endif
13+
#else
14+
#define OOPETRIS_GRAPHICS_EXPORTED
15+
#endif

src/libs/core/hash-library/sha256.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ typedef unsigned __int8 uint8_t;
1818
typedef unsigned __int32 uint32_t;
1919
typedef unsigned __int64 uint64_t;
2020

21+
#if defined(HASH_LIBRARY_COMPILATION)
2122
#if defined(HASH_LIBRARY_EXPORT)
2223
#define HASH_LIBRARY_EXPORTED __declspec(dllexport)
2324
#else
2425
#define HASH_LIBRARY_EXPORTED __declspec(dllimport)
2526
#endif
27+
#else
28+
#define HASH_LIBRARY_EXPORTED
29+
#endif
2630

2731
#else
2832
// GCC

src/libs/core/helper/windows.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#if defined(_MSC_VER)
4+
#if defined(OOPETRIS_LIBRARY_CORE_COMPILATION)
45
#if defined(OOPETRIS_LIBRARY_CORE_EXPORT)
56
#define OOPETRIS_CORE_EXPORTED __declspec(dllexport)
67
#else
@@ -9,3 +10,6 @@
910
#else
1011
#define OOPETRIS_CORE_EXPORTED
1112
#endif
13+
#else
14+
#define OOPETRIS_CORE_EXPORTED
15+
#endif

src/libs/core/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ liboopetris_core = library(
1313
core_header_files,
1414
include_directories: core_lib.get('inc_dirs'),
1515
dependencies: core_lib.get('deps'),
16-
cpp_args: core_lib.get('compile_args'),
16+
cpp_args: [core_lib.get('compile_args'),'-DOOPETRIS_LIBRARY_CORE_COMPILATION','-DHASH_LIBRARY_COMPILATION'],
1717
cpp_shared_args: ['-DOOPETRIS_LIBRARY_CORE_EXPORT', '-DHASH_LIBRARY_EXPORT'],
1818
override_options: {
1919
'warning_level': '3',

src/libs/recordings/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ liboopetris_recordings = library(
1616
recordings_header_files,
1717
include_directories: recordings_lib.get('inc_dirs'),
1818
dependencies: recordings_lib.get('deps'),
19-
cpp_args: recordings_lib.get('compile_args'),
19+
cpp_args: [recordings_lib.get('compile_args'),'-DOOPETRIS_LIBRARY_RECORDINGS_COMPILATION'],
2020
cpp_shared_args: ['-DOOPETRIS_LIBRARY_RECORDINGS_EXPORT'],
2121
override_options: {
2222
'warning_level': '3',

src/libs/recordings/utility/windows.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#if defined(_MSC_VER)
4+
#if defined(OOPETRIS_LIBRARY_RECORDINGS_COMPILATION)
45
#if defined(OOPETRIS_LIBRARY_RECORDINGS_EXPORT)
56
#define OOPETRIS_RECORDINGS_EXPORTED __declspec(dllexport)
67
#else
@@ -9,3 +10,6 @@
910
#else
1011
#define OOPETRIS_RECORDINGS_EXPORTED
1112
#endif
13+
#else
14+
#define OOPETRIS_RECORDINGS_EXPORTED
15+
#endif

src/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if build_application
3030
graphics_src_files,
3131
include_directories: graphics_lib.get('inc_dirs'),
3232
dependencies: graphics_lib.get('deps'),
33-
cpp_args: graphics_lib.get('compile_args'),
33+
cpp_args: [graphics_lib.get('compile_args'),'-DOOPETRIS_LIBRARY_GRAPHICS_COMPILATION'],
3434
cpp_shared_args: ['-DOOPETRIS_LIBRARY_GRAPHICS_EXPORT'],
3535
override_options: {
3636
'warning_level': '3',

0 commit comments

Comments
 (0)