mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-22 16:02:54 +02:00
Share object files between powder/render/font
I'm not sure why we weren't using static_libraries to begin with; most likely because the object files (as opposed to the sources) were not possible to share due to different sets of macros being defined in cpp_args, see3a591b8539
to4f0c365e05
.
This commit is contained in:
67
meson.build
67
meson.build
@@ -459,9 +459,7 @@ foreach embedded_file : embedded_files
|
|||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
powder_files += powder_external_files
|
powder_files += powder_external_files
|
||||||
powder_files += data_files
|
common_files += data_files
|
||||||
render_files += data_files
|
|
||||||
font_files += data_files
|
|
||||||
|
|
||||||
if host_platform == 'emscripten'
|
if host_platform == 'emscripten'
|
||||||
project_link_args += [
|
project_link_args += [
|
||||||
@@ -487,17 +485,49 @@ endif
|
|||||||
|
|
||||||
clang_tidy_sources = []
|
clang_tidy_sources = []
|
||||||
|
|
||||||
|
sta_libs = {}
|
||||||
|
foreach sta_info : [
|
||||||
|
[ 'common', common_files, [
|
||||||
|
host_platform == 'android' ? sdl2_dep : [],
|
||||||
|
png_dep,
|
||||||
|
zlib_dep,
|
||||||
|
bzip2_dep,
|
||||||
|
] ],
|
||||||
|
[ 'gui', gui_files, [
|
||||||
|
sdl2_dep,
|
||||||
|
] ],
|
||||||
|
[ 'simulation', simulation_files, [
|
||||||
|
json_dep,
|
||||||
|
] ],
|
||||||
|
]
|
||||||
|
sta_name = sta_info[0]
|
||||||
|
sta_srcs = sta_info[1]
|
||||||
|
sta_deps = sta_info[2]
|
||||||
|
sta_libs += { sta_name: declare_dependency(
|
||||||
|
include_directories: project_inc,
|
||||||
|
link_with: static_library(
|
||||||
|
sta_name,
|
||||||
|
sources: sta_srcs,
|
||||||
|
include_directories: project_inc,
|
||||||
|
cpp_args: project_cpp_args,
|
||||||
|
override_options: target_options,
|
||||||
|
pic: host_platform == 'android',
|
||||||
|
dependencies: sta_deps,
|
||||||
|
),
|
||||||
|
dependencies: sta_deps,
|
||||||
|
) }
|
||||||
|
clang_tidy_sources += sta_srcs
|
||||||
|
endforeach
|
||||||
|
|
||||||
if get_option('build_powder')
|
if get_option('build_powder')
|
||||||
powder_deps += project_deps + [
|
powder_deps += project_deps + [
|
||||||
threads_dep,
|
threads_dep,
|
||||||
zlib_dep,
|
|
||||||
png_dep,
|
|
||||||
sdl2_dep,
|
|
||||||
lua_dep,
|
lua_dep,
|
||||||
curl_dep,
|
curl_dep,
|
||||||
fftw_dep,
|
fftw_dep,
|
||||||
bzip2_dep,
|
sta_libs['common'],
|
||||||
json_dep,
|
sta_libs['gui'],
|
||||||
|
sta_libs['simulation'],
|
||||||
]
|
]
|
||||||
if host_platform == 'android'
|
if host_platform == 'android'
|
||||||
powder_sha = shared_library(
|
powder_sha = shared_library(
|
||||||
@@ -530,15 +560,13 @@ if get_option('build_powder')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('build_render')
|
if get_option('build_render')
|
||||||
if host_platform == 'emscripten'
|
if host_platform in [ 'android', 'emscripten' ]
|
||||||
error('render does not target emscripten')
|
error('render does not target @0@'.format(host_platform))
|
||||||
endif
|
endif
|
||||||
render_deps = project_deps + [
|
render_deps = project_deps + [
|
||||||
threads_dep,
|
threads_dep,
|
||||||
zlib_dep,
|
sta_libs['common'],
|
||||||
bzip2_dep,
|
sta_libs['simulation'],
|
||||||
json_dep,
|
|
||||||
png_dep,
|
|
||||||
]
|
]
|
||||||
render_link_args = project_link_args
|
render_link_args = project_link_args
|
||||||
if host_platform == 'linux' and is_static
|
if host_platform == 'linux' and is_static
|
||||||
@@ -559,16 +587,13 @@ if get_option('build_render')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('build_font')
|
if get_option('build_font')
|
||||||
if host_platform == 'emscripten'
|
if host_platform in [ 'android', 'emscripten' ]
|
||||||
error('font does not target emscripten')
|
error('font does not target @0@'.format(host_platform))
|
||||||
endif
|
endif
|
||||||
font_deps = project_deps + [
|
font_deps = project_deps + [
|
||||||
threads_dep,
|
threads_dep,
|
||||||
zlib_dep,
|
sta_libs['common'],
|
||||||
png_dep,
|
sta_libs['gui'],
|
||||||
sdl2_dep,
|
|
||||||
bzip2_dep,
|
|
||||||
json_dep,
|
|
||||||
]
|
]
|
||||||
executable(
|
executable(
|
||||||
'font',
|
'font',
|
||||||
|
36
src/common/clipboard/Local.cpp
Normal file
36
src/common/clipboard/Local.cpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#include "Clipboard.h"
|
||||||
|
#include "client/GameSave.h"
|
||||||
|
|
||||||
|
namespace Clipboard
|
||||||
|
{
|
||||||
|
void SetClipboardData(std::unique_ptr<GameSave> data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const GameSave *GetClipboardData()
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Init()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetEnabled()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetEnabled(bool)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RecreateWindow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<String> Explanation()
|
||||||
|
{
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,36 +1,12 @@
|
|||||||
#include "Clipboard.h"
|
#include "Clipboard.h"
|
||||||
#include "client/GameSave.h"
|
|
||||||
|
|
||||||
namespace Clipboard
|
namespace Clipboard
|
||||||
{
|
{
|
||||||
void SetClipboardData(std::unique_ptr<GameSave> data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const GameSave *GetClipboardData()
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetEnabled()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetEnabled(bool)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void RecreateWindow()
|
void RecreateWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<String> Explanation()
|
|
||||||
{
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ if platform_clipboard
|
|||||||
endif
|
endif
|
||||||
powder_files += files('Dynamic.cpp')
|
powder_files += files('Dynamic.cpp')
|
||||||
else
|
else
|
||||||
powder_files += files('Null.cpp')
|
powder_files += files('Local.cpp')
|
||||||
endif
|
endif
|
||||||
render_files += files('Null.cpp')
|
render_files += files('Null.cpp')
|
||||||
font_files += files('Null.cpp')
|
font_files += files('Null.cpp')
|
||||||
|
@@ -8,6 +8,6 @@ powder_graphics_files = files(
|
|||||||
'Renderer.cpp',
|
'Renderer.cpp',
|
||||||
)
|
)
|
||||||
|
|
||||||
powder_files += graphics_files + powder_graphics_files
|
common_files += graphics_files
|
||||||
render_files += graphics_files + powder_graphics_files
|
powder_files += powder_graphics_files
|
||||||
font_files += graphics_files
|
render_files += powder_graphics_files
|
||||||
|
@@ -21,6 +21,3 @@ subdir('save')
|
|||||||
subdir('search')
|
subdir('search')
|
||||||
subdir('tags')
|
subdir('tags')
|
||||||
subdir('update')
|
subdir('update')
|
||||||
|
|
||||||
powder_files += gui_files
|
|
||||||
font_files += gui_files
|
|
||||||
|
@@ -203,10 +203,6 @@ subdir('resampler')
|
|||||||
subdir('simulation')
|
subdir('simulation')
|
||||||
subdir('tasks')
|
subdir('tasks')
|
||||||
|
|
||||||
powder_files += common_files
|
|
||||||
render_files += common_files
|
|
||||||
font_files += common_files
|
|
||||||
|
|
||||||
simulation_elem_defs = []
|
simulation_elem_defs = []
|
||||||
foreach elem_name_id : simulation_elem_ids
|
foreach elem_name_id : simulation_elem_ids
|
||||||
simulation_elem_defs += 'ELEMENT_DEFINE(' + elem_name_id[0] + ', ' + elem_name_id[1].to_string() + ');'
|
simulation_elem_defs += 'ELEMENT_DEFINE(' + elem_name_id[0] + ', ' + elem_name_id[1].to_string() + ');'
|
||||||
|
@@ -2,6 +2,4 @@ resampler_files = files(
|
|||||||
'resampler.cpp',
|
'resampler.cpp',
|
||||||
)
|
)
|
||||||
|
|
||||||
powder_files += resampler_files
|
common_files += resampler_files
|
||||||
render_files += resampler_files
|
|
||||||
font_files += resampler_files
|
|
||||||
|
@@ -16,9 +16,6 @@ subdir('elements')
|
|||||||
subdir('simtools')
|
subdir('simtools')
|
||||||
subdir('gravity')
|
subdir('gravity')
|
||||||
|
|
||||||
powder_files += simulation_files
|
|
||||||
render_files += simulation_files
|
|
||||||
|
|
||||||
powder_files += files(
|
powder_files += files(
|
||||||
'AccessPropertyParse.cpp',
|
'AccessPropertyParse.cpp',
|
||||||
'Editing.cpp',
|
'Editing.cpp',
|
||||||
|
Reference in New Issue
Block a user