From 7c1c9a697e347fa0ab11e9cd64ef2bac5f42fa4f Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 18 Jun 2023 22:59:01 -0500 Subject: [PATCH] [teagba] Make TeaGBA (other than the ARM asm) build on all platforms --- deps/teagba/CMakeLists.txt | 7 +++++++ deps/teagba/src/CMakeLists.txt | 19 ++++++++++++------- deps/teagba/src/bios_stub.cpp | 22 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 deps/teagba/src/bios_stub.cpp diff --git a/deps/teagba/CMakeLists.txt b/deps/teagba/CMakeLists.txt index febd4f0a..8fe62ad8 100644 --- a/deps/teagba/CMakeLists.txt +++ b/deps/teagba/CMakeLists.txt @@ -1 +1,8 @@ add_subdirectory(src) + +install( + DIRECTORY + include/teagba + DESTINATION + include +) diff --git a/deps/teagba/src/CMakeLists.txt b/deps/teagba/src/CMakeLists.txt index 05477b5a..0069dd24 100644 --- a/deps/teagba/src/CMakeLists.txt +++ b/deps/teagba/src/CMakeLists.txt @@ -1,18 +1,23 @@ enable_language(CXX ASM) -set_source_files_properties(gfx.cpp PROPERTIES COMPILE_FLAGS -marm) - add_library( TeaGBA - bios.s - gba_crt0.s cstartup.cpp gfx.cpp ) -if(NOT MSVC) - target_compile_options(TeaGBA PRIVATE -Wsign-conversion) - target_compile_options(TeaGBA PRIVATE -Wconversion) +if(TURBINE_BUILD_TYPE STREQUAL "GBA") + set_source_files_properties(gfx.cpp PROPERTIES COMPILE_FLAGS -marm) + target_sources( + TeaGBA PRIVATE + bios.s + gba_crt0.s + ) +else() + target_sources( + TeaGBA PRIVATE + bios_stub.cpp + ) endif() target_include_directories( diff --git a/deps/teagba/src/bios_stub.cpp b/deps/teagba/src/bios_stub.cpp new file mode 100644 index 00000000..a1434b99 --- /dev/null +++ b/deps/teagba/src/bios_stub.cpp @@ -0,0 +1,22 @@ +/* + * Copyright 2016 - 2023 gary@drinkingtea.net + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +// stubs for building TeaGBA for PC targets, for purposes of not having to +// switch back and forth between builds when editing GBA files + +extern "C" { + +void teagba_halt() {} + +void teagba_stop() {} + +void teagba_intrwait(unsigned, unsigned) {} + +void teagba_vblankintrwait() {} + +}