Skip to content

Commit

Permalink
Merge pull request #13 from V-Sekai-fire/exact-godot-4.2.2
Browse files Browse the repository at this point in the history
Try to make godot-riscv work on windows.
  • Loading branch information
fwsGonzo authored Jul 21, 2024
2 parents 060ca63 + ff11743 commit 6be6720
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ option(STATIC_BUILD "Build statically" OFF)
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")

set(SOURCES
src/gvar.cpp
src/shmain.cpp
src/gvar.cpp
src/shmain.cpp
src/register_types.cpp
src/syscalls.cpp
)

set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

# Check if MinGW
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
if (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++ -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
endif()

if (SANITIZE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
Expand All @@ -36,5 +40,5 @@ add_library(godot-riscv SHARED ${SOURCES})
target_link_libraries(godot-riscv PUBLIC riscv godot-cpp)

if (STATIC_BUILD)
target_link_libraries(godot-riscv PUBLIC -static)
target_link_libraries(godot-riscv PUBLIC -static)
endif()

0 comments on commit 6be6720

Please sign in to comment.