Properly copy data on macOS
This also fixes cfg init failing on macOS
This commit is contained in:
parent
5d0f629ca7
commit
7f479b0e0b
3 changed files with 14 additions and 10 deletions
|
@ -68,8 +68,6 @@ engine::engine(const int argc, char* argv[]) {
|
|||
quit();
|
||||
});
|
||||
|
||||
console::load_cfg(prism::app_domain / "render_options.cfg");
|
||||
|
||||
for(int i = 0; i < argc; i++)
|
||||
command_line_arguments.emplace_back(argv[i]);
|
||||
|
||||
|
@ -89,6 +87,8 @@ void engine::set_app(prism::app* p_app) {
|
|||
if(platform::supports_feature(PlatformFeature::Windowing) && ::engine->get_app()->is_multimodal()) {
|
||||
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
}
|
||||
|
||||
console::load_cfg(prism::app_domain / "render_options.cfg");
|
||||
}
|
||||
|
||||
prism::app* engine::get_app() const {
|
||||
|
|
|
@ -58,11 +58,17 @@ function(add_platform_commands target)
|
|||
endif()
|
||||
|
||||
if(NOT SKIP_DATA)
|
||||
if(ENABLE_MACOS)
|
||||
add_custom_target(${target}_copy_assets
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/example/data/ $<TARGET_FILE_DIR:${target}>/../Resources/data
|
||||
)
|
||||
else()
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/data)
|
||||
|
||||
add_custom_target(${target}_copy_assets
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/example/data/ ${CMAKE_BINARY_DIR}/bin/data
|
||||
)
|
||||
endif()
|
||||
add_dependencies(${target} ${target}_copy_assets)
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
|
@ -463,18 +463,16 @@ int main(int argc, char* argv[]) {
|
|||
backend.init_func();
|
||||
}
|
||||
|
||||
app = new @APP_CLASS@();
|
||||
engine->set_app(app);
|
||||
|
||||
GFXCreateInfo info = {};
|
||||
|
||||
if(gfx_interface->initialize(info)) {
|
||||
engine->set_gfx(gfx_interface);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
app = new @APP_CLASS@();
|
||||
app_main(engine);
|
||||
engine->set_app(app);
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
|
||||
|
|
Reference in a new issue