From 02deee0f2a155933c622a861cc254f8b30dd4ca0 Mon Sep 17 00:00:00 2001 From: Curle Date: Wed, 8 Nov 2023 15:45:03 +0000 Subject: [PATCH] Fix minor issues running on linux. --- CMakeLists.txt | 7 ++++--- source/vm/ClassHeap.cpp | 2 +- source/vm/EntryPoint.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bd660a..fe1275b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,9 @@ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) +# CMAKE dependencies +find_package(Threads REQUIRED) + add_compile_options( # gcc and clang: debugging symbols "$<$:-g>" @@ -53,9 +56,6 @@ add_compile_options( # windows: mingw and msys; use ANSI compatible printf, workaround a gcc bug. "$<$:-D__USE_MINGW_ANSI_STDIO>" - - # all systems and compilers: link threading library - "-pthread" ) # ****************************************** @@ -94,6 +94,7 @@ add_executable(purpuri) target_sources(purpuri PRIVATE ${vm_src}) set_target_properties(purpuri PROPERTIES ENABLE_EXPORTS ON) target_compile_definitions(purpuri PRIVATE VM_BUILDING) +target_link_libraries(purpuri PRIVATE Threads::Threads) # Linux needs to compile against -ldl if (UNIX) diff --git a/source/vm/ClassHeap.cpp b/source/vm/ClassHeap.cpp index e93702b..ad8395e 100644 --- a/source/vm/ClassHeap.cpp +++ b/source/vm/ClassHeap.cpp @@ -89,7 +89,7 @@ Class* ClassHeap::GetClass(const std::string& Name) { * These locations are searched in that order when trying to load classes. */ void ClassHeap::AddToClassPath(std::string path) { - ClassPath.emplace_back(path.append("\\")); + ClassPath.emplace_back(path + std::filesystem::path::preferred_separator); } /** diff --git a/source/vm/EntryPoint.cpp b/source/vm/EntryPoint.cpp index d4e182c..9dd3552 100644 --- a/source/vm/EntryPoint.cpp +++ b/source/vm/EntryPoint.cpp @@ -19,7 +19,7 @@ * @param Name the name of the Purpuri executable. */ void DisplayUsage(char* Name) { - fprintf(stderr, "Purpuri VM v1.6 - Gemwire Institute\n"); + fprintf(stderr, "Purpuri VM v1.7a - Gemwire Institute\n"); fprintf(stderr, "***************************************\n"); fprintf(stderr, "Usage: %s \n", Name); #ifdef VISUAL_DEBUGGER