Fix macOS compilation

This commit is contained in:
Luke Street 2022-02-04 23:25:35 -05:00
parent 509252a17f
commit 8e695dce74
6 changed files with 26 additions and 19 deletions

View File

@ -27,14 +27,20 @@ fn main() {
// let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); // let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
// bindings.write_to_file(out_path.join("zeus.rs")).expect("Couldn't write bindings!"); // bindings.write_to_file(out_path.join("zeus.rs")).expect("Couldn't write bindings!");
#[cfg(any(not(unix), target_os = "macos", target_os = "ios"))]
let cxx_flag = "-std=c++17";
#[cfg(all(unix, not(any(target_os = "macos", target_os = "ios"))))]
let cxx_flag = "-std=gnu++17";
cxx_build::bridge("src/lib.rs") cxx_build::bridge("src/lib.rs")
.include("include") .include("include")
.include(zeus_include.clone()) .include(zeus_include.clone())
.flag(cxx_flag)
.compile("aurora"); .compile("aurora");
println!("cargo:rerun-if-changed=src/lib.rs"); println!("cargo:rerun-if-changed=src/lib.rs");
cxx_build::bridge("src/shaders/mod.rs") cxx_build::bridge("src/shaders/mod.rs")
.include("include") .include("include")
.include(zeus_include.clone()) .include(zeus_include.clone())
.flag(cxx_flag)
.compile("aurora_shaders"); .compile("aurora_shaders");
println!("cargo:rerun-if-changed=src/shaders/mod.rs"); println!("cargo:rerun-if-changed=src/shaders/mod.rs");
cxx_build::bridge("src/imgui.rs") cxx_build::bridge("src/imgui.rs")
@ -42,6 +48,7 @@ fn main() {
.include(zeus_include.clone()) .include(zeus_include.clone())
.include(imgui_include.clone()) .include(imgui_include.clone())
.include(imgui_engine_include.clone()) .include(imgui_engine_include.clone())
.flag(cxx_flag)
.compile("aurora_imgui"); .compile("aurora_imgui");
println!("cargo:rerun-if-changed=src/imgui.rs"); println!("cargo:rerun-if-changed=src/imgui.rs");
} }

View File

@ -13,8 +13,8 @@ void CGameOptionsTouchBar::GetSelection(int& left, int& right, int& value) {
void CGameOptionsTouchBar::SetSelection([[maybe_unused]] int left, [[maybe_unused]] int right, void CGameOptionsTouchBar::SetSelection([[maybe_unused]] int left, [[maybe_unused]] int right,
[[maybe_unused]] int value) {} [[maybe_unused]] int value) {}
#ifndef __APPLE__ //#ifndef __APPLE__
std::unique_ptr<CGameOptionsTouchBar> NewGameOptionsTouchBar() { return std::make_unique<CGameOptionsTouchBar>(); } std::unique_ptr<CGameOptionsTouchBar> NewGameOptionsTouchBar() { return std::make_unique<CGameOptionsTouchBar>(); }
#endif //#endif
} // namespace metaforce } // namespace metaforce

View File

@ -39,14 +39,14 @@ add_subdirectory(MP1)
add_subdirectory(MP2) add_subdirectory(MP2)
add_subdirectory(MP3) add_subdirectory(MP3)
if (APPLE) #if (APPLE)
set_source_files_properties(MP1/CFrontEndUITouchBarMac.mm # set_source_files_properties(MP1/CFrontEndUITouchBarMac.mm
MP1/CSaveGameScreenTouchBarMac.mm # MP1/CSaveGameScreenTouchBarMac.mm
CGameOptionsTouchBarMac.mm # CGameOptionsTouchBarMac.mm
PROPERTIES COMPILE_FLAGS -fobjc-arc) # PROPERTIES COMPILE_FLAGS -fobjc-arc)
bintoc(startButton.cpp Resources/startButton@2x.png START_BUTTON_2X) # bintoc(startButton.cpp Resources/startButton@2x.png START_BUTTON_2X)
list(APPEND PLAT_SRCS startButton.cpp CGameOptionsTouchBarMac.mm) # list(APPEND PLAT_SRCS startButton.cpp CGameOptionsTouchBarMac.mm)
endif () #endif ()
set(CAST_TO_SOURCES set(CAST_TO_SOURCES
MkCastTo.py MkCastTo.py

View File

@ -13,8 +13,8 @@ void CFrontEndUITouchBar::SetFusionBonusPhase(bool fusionSuitActive) { m_phase =
void CFrontEndUITouchBar::SetStartOptionsPhase(bool normalBeat) { m_phase = EPhase::StartOptions; } void CFrontEndUITouchBar::SetStartOptionsPhase(bool normalBeat) { m_phase = EPhase::StartOptions; }
CFrontEndUITouchBar::EAction CFrontEndUITouchBar::PopAction() { return EAction::None; } CFrontEndUITouchBar::EAction CFrontEndUITouchBar::PopAction() { return EAction::None; }
#ifndef __APPLE__ //#ifndef __APPLE__
std::unique_ptr<CFrontEndUITouchBar> NewFrontEndUITouchBar() { return std::make_unique<CFrontEndUITouchBar>(); } std::unique_ptr<CFrontEndUITouchBar> NewFrontEndUITouchBar() { return std::make_unique<CFrontEndUITouchBar>(); }
#endif //#endif
} // namespace metaforce } // namespace metaforce

View File

@ -1,10 +1,10 @@
add_subdirectory(World) add_subdirectory(World)
if (APPLE) #if (APPLE)
set(MP1_PLAT_SOURCES # set(MP1_PLAT_SOURCES
CFrontEndUITouchBarMac.mm # CFrontEndUITouchBarMac.mm
CSaveGameScreenTouchBarMac.mm) # CSaveGameScreenTouchBarMac.mm)
endif () #endif ()
set(MP1_SOURCES set(MP1_SOURCES
CTweaks.hpp CTweaks.cpp CTweaks.hpp CTweaks.cpp

View File

@ -5,8 +5,8 @@ namespace metaforce::MP1 {
int CSaveGameScreenTouchBar::PopOption() { return -1; } int CSaveGameScreenTouchBar::PopOption() { return -1; }
void CSaveGameScreenTouchBar::SetUIOpts(std::u16string_view opt0, std::u16string_view opt1, std::u16string_view opt2) {} void CSaveGameScreenTouchBar::SetUIOpts(std::u16string_view opt0, std::u16string_view opt1, std::u16string_view opt2) {}
#ifndef __APPLE__ //#ifndef __APPLE__
std::unique_ptr<CSaveGameScreenTouchBar> NewSaveUITouchBar() { return std::make_unique<CSaveGameScreenTouchBar>(); } std::unique_ptr<CSaveGameScreenTouchBar> NewSaveUITouchBar() { return std::make_unique<CSaveGameScreenTouchBar>(); }
#endif //#endif
} // namespace metaforce::MP1 } // namespace metaforce::MP1