Skip to content

Commit

Permalink
Fix minor issues running on linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCurle committed Nov 8, 2023
1 parent 7a7c7e8 commit 02deee0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
"$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-g>"
Expand Down Expand Up @@ -53,9 +56,6 @@ add_compile_options(

# windows: mingw and msys; use ANSI compatible printf, workaround a gcc bug.
"$<$<PLATFORM_ID:Windows>:-D__USE_MINGW_ANSI_STDIO>"

# all systems and compilers: link threading library
"-pthread"
)

# ******************************************
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source/vm/ClassHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source/vm/EntryPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class file>\n", Name);
#ifdef VISUAL_DEBUGGER
Expand Down

0 comments on commit 02deee0

Please sign in to comment.