From e8388f06bada8f3fbc1e74f28fe81eda053e5d2d Mon Sep 17 00:00:00 2001 From: Hepatica Date: Fri, 9 Aug 2024 21:04:21 +0200 Subject: [PATCH] update cmake config --- CMakeLists.txt | 22 ++++++++++++++++------ SpCloudMain/SpCloudMain.cpp | 4 +++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 106a1f9..eb11371 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,25 @@ -# CMakeList.txt : Top-level CMake project file, do global configuration -# and include sub-projects here. -# -cmake_minimum_required (VERSION 3.8) +cmake_minimum_required (VERSION 3.8) -# Enable Hot Reload for MSVC compilers if supported. +# Enable Hot Reload for MSVC compilers if supported (only applicable on Windows). if (POLICY CMP0141) cmake_policy(SET CMP0141 NEW) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() project ("SpCloudMain") +# Platform-specific settings +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + # Windows-specific configuration + if (MSVC) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") + endif() +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Linux-specific configuration + # Here you can add Linux-specific flags, libraries, etc. + # For example, enabling C++17 or another specific Linux configuration + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED True) +endif() + # Include sub-projects. add_subdirectory ("SpCloudMain") diff --git a/SpCloudMain/SpCloudMain.cpp b/SpCloudMain/SpCloudMain.cpp index fb528e2..10c8212 100644 --- a/SpCloudMain/SpCloudMain.cpp +++ b/SpCloudMain/SpCloudMain.cpp @@ -9,7 +9,9 @@ int main() { while (true) { - cout << "Hello CMake." << endl; + cout << "Hello ." << endl; + cout << "Hello 2." << endl; } + return 0; }