From 57b84449a45afd5e56e2eaf857196caa95ef66cc Mon Sep 17 00:00:00 2001 From: offtkp Date: Mon, 4 Sep 2023 12:50:28 +0300 Subject: [PATCH] Thanks windows v3 --- CMakeLists.txt | 26 ++++++++++---------------- gb/gb_tkpwrapper.hxx | 2 +- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 706c0815..9cd0efa2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,9 +15,12 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(THREADS_PREFER_PTHREAD_FLAG ON) -# TODO: don't always compile with -g -# TODO: compiler based -if (LINUX) +# TODO: prettify +if (WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") +elseif (APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") +elseif (LINUX) set(WARNINGS "-Werror=return-type" "-Werror=unused-variable" @@ -29,18 +32,10 @@ if (LINUX) "-Werror=shadow" "-Werror=deprecated-declarations" ) -endif() -string(REPLACE ";" " " WARNINGS_FLAGS "${WARNINGS}") -set(CMAKE_CXX_FLAGS "-g -O2") -set(CMAKE_C_FLAGS "-g -O2") -# TODO: prettify -if (WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") -endif() -if (APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcrc32 ${WARNINGS_FLAGS}") + string(REPLACE ";" " " WARNINGS_FLAGS "${WARNINGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcrc32 ${WARNINGS_FLAGS} -g -O2") +else + message(FATAL_ERROR "Unsupported platform") endif() set(OpenGL_GL_PREFERENCE GLVND) @@ -63,7 +58,6 @@ set(PROJECT_SOURCES qt/keypicker.cxx qt/nes_ppuviewer.cxx qt/mmioviewer.cxx - src/emulator.cxx src/global.cxx ) diff --git a/gb/gb_tkpwrapper.hxx b/gb/gb_tkpwrapper.hxx index 84255264..7bb13758 100644 --- a/gb/gb_tkpwrapper.hxx +++ b/gb/gb_tkpwrapper.hxx @@ -20,7 +20,7 @@ namespace hydra namespace Gameboy::QA { - struct TestGameboy; + class TestGameboy; } } // namespace hydra class MmioViewer;