From ec45447520a6d10a2b80cbd097a5c760c22780fc Mon Sep 17 00:00:00 2001 From: Bubio Date: Mon, 9 Oct 2023 23:39:57 +0900 Subject: [PATCH] Update build settings --- Builder/Linux/dist_app.sh | 4 ++-- CMakeLists.txt | 30 +++++++++++------------------- Source/Filter/xBRZ/CMakeLists.txt | 1 + 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/Builder/Linux/dist_app.sh b/Builder/Linux/dist_app.sh index c6793d8..f2c09e6 100755 --- a/Builder/Linux/dist_app.sh +++ b/Builder/Linux/dist_app.sh @@ -23,7 +23,7 @@ cmake --build build -j 2 --target package if [ -f build/xm8*.rpm ]; then mv build/xm8*.rpm build/xm8_linux_x86_64.rpm - read -p "Do you want to install the package? (y/N): " yn + read -p "Do you want to install the rpm package? (y/N): " yn case "$yn" in [yY]*) ;; *) echo "abort." ; exit ;; esac sudo dnf install ./build/xm8_linux_x86_64.rpm fi @@ -31,7 +31,7 @@ fi if [ -f build/xm8*.deb ]; then mv build/xm8*.deb build/xm8_linux_x86_64.deb - read -p "Do you want to install the package? (y/N): " yn + read -p "Do you want to install the deb package? (y/N): " yn case "$yn" in [yY]*) ;; *) echo "abort." ; exit ;; esac sudo apt install ./build/xm8_linux_x86_64.deb fi diff --git a/CMakeLists.txt b/CMakeLists.txt index a8cff8f..06ec8f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,12 +48,10 @@ if(CCACHE_PROGRAM) set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") endif() -# Despite setting C++ standard to 20, features from this version are not being used. -# The oldest compiler used is GCC 6.5 - and that defines our C++ feature set (meaning most of C++17). -# It's present only to take advantage of fmt::format build time errors. -# set(CMAKE_CXX_STANDARD 20) -# set(CMAKE_CXX_EXTENSIONS OFF) -# set(CMAKE_CXX_STANDARD_REQUIRED OFF) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_C_STANDARD 17) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED OFF) # set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # for clang-tidy # set(CMAKE_THREAD_PREFER_PTHREAD ON) # set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -62,7 +60,6 @@ endif() # Find SDL2 library and add to linker flags if(NOT APPLE) - # find_package(SDL2 2.24.2 EXACT REQUIRED) find_package(SDL2 REQUIRED) else() # Dependencies must be included after Platforms. @@ -78,18 +75,13 @@ add_definitions(-D_PC8801MA) # Set compile options add_compile_options(-Wall) -if(APPLE) - add_compile_options( - -Wno-macro-redefined - -Wno-non-c-typedef-for-linkage - -Wno-deprecated-declarations - -Wno-overloaded-virtual - -Wno-c++11-compat-deprecated-writable-strings) -else() - add_compile_options(-Wno-narrowing) -endif() -add_compile_options(-Wno-c++11-extensions) - +add_compile_options( + -Wno-macro-redefined + -Wno-non-c-typedef-for-linkage + -Wno-deprecated-declarations + -Wno-overloaded-virtual + -Wno-c++11-compat-deprecated-writable-strings + -Wno-narrowing) # Include directories include_directories( diff --git a/Source/Filter/xBRZ/CMakeLists.txt b/Source/Filter/xBRZ/CMakeLists.txt index 3c06c87..ee51c89 100644 --- a/Source/Filter/xBRZ/CMakeLists.txt +++ b/Source/Filter/xBRZ/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.10) set(CMAKE_CXX_STANDARD 17) +set(CMAKE_C_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED OFF) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13.0") include_directories(${CMAKE_CURRENT_SOURCE_DIR})