From 41d2d2121fd0fd3b1b84067339679ae5c0a003f2 Mon Sep 17 00:00:00 2001 From: Joseph Aquino Date: Fri, 26 Dec 2025 01:20:47 -0500 Subject: [PATCH] starting to add windows support --- CMakeLists.txt | 12 ++++++++++-- build.bat | 5 +++++ src/shellUtils.cpp | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 build.bat diff --git a/CMakeLists.txt b/CMakeLists.txt index d9d4aa4..c8aad85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,19 @@ -cmake_minimum_required(VERSION 4.1) +cmake_minimum_required(VERSION 3.10) project(shell) + + +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/windows) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/linux) +endif() + set(CMAKE_CXX_STANDARD 23) add_executable(shell src/main.cpp src/shellUtils.cpp include/shellUtils.h) -target_link_libraries(shell PRIVATE readline) target_include_directories(shell PRIVATE include) \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..c664eef --- /dev/null +++ b/build.bat @@ -0,0 +1,5 @@ +mkdir build +cd build +cmake -S .. -B . +cmake --build . +PAUSE \ No newline at end of file diff --git a/src/shellUtils.cpp b/src/shellUtils.cpp index e9ee394..6935408 100644 --- a/src/shellUtils.cpp +++ b/src/shellUtils.cpp @@ -25,7 +25,7 @@ namespace sh { const std::string_view pathEnv {std::getenv("PATH")}; -#if _WIN32 +#if WIN32 constexpr char delimiter {';'}; #else constexpr char delimiter {':'};