Bunch of fixes for Windows.

This commit is contained in:
Deukhoofd 2021-08-29 12:14:27 +02:00
parent f320159e50
commit f5fceb32fb
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 13 additions and 1 deletions

View File

@ -17,3 +17,15 @@ add_definitions(-DLEVEL_U8)
SET(_LINKS Arbutils CreatureLib pkmnLib -lpthread)
target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS})
target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror)
if (WINDOWS)
MESSAGE(WARNING, "Using Windows Build.")
# Add a definition for the compiler, so we can use it in C++ as well.
ADD_DEFINITIONS(-D WINDOWS=1)
# -m64: Build a 64 bit library
add_compile_options(-m64)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-allow-multiple-definition")
if (SHARED)
set_target_properties(PokemonScriptTester PROPERTIES SUFFIX ".dll")
endif(SHARED)
endif (WINDOWS)

View File

@ -38,7 +38,7 @@ int main(int argc, char** argv) {
workingDirectory = args::get(workingDirFlag);
}
if (!workingDirectory.empty()) {
chdir(std::filesystem::path(workingDirectory).c_str());
chdir((const char*)std::filesystem::path(workingDirectory).c_str());
}
std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();