-
Based on this patch for Supertux 0.6.3 release: #16518 https://github.com/iahung/supertux Building fine, but failed to link. Changing the libraries order like the patch doesn't work. Please help @Biswa96 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Could you provide the error message? I've compiled the supertux git repository with same modifications as in the mingw package. Though not exactly same patches (as expected). |
Beta Was this translation helpful? Give feedback.
-
Here is the changes required to compile supertux main branch with mingw toolchain. Click here to see the diffdiff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b9d461..a5ab299 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -231,7 +231,7 @@ if(EMSCRIPTEN)
target_link_options(supertux2 PUBLIC -sEXPORTED_FUNCTIONS=['_main','_set_resolution','_save_config','_onDownloadProgress','_onDownloadFinished','_onDownloadError','_onDownloadAborted','_getExceptionMessage'] PUBLIC -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap'] PUBLIC -sEXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap'])
endif()
-if(WIN32 AND NOT VCPKG_BUILD)
+if(MSVC AND NOT VCPKG_BUILD)
## Copy dlls on windows
add_custom_command(TARGET supertux2_lib POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
@@ -250,17 +250,18 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
target_include_directories(supertux2_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
endif()
+target_link_libraries(supertux2_lib PUBLIC LibSDL2_ttf)
+target_link_libraries(supertux2_lib PUBLIC LibTinygettext)
+target_link_libraries(supertux2_lib PUBLIC LibSavePNG)
+
## Link supertux binary with squirrel and other libraries
if(NOT EMSCRIPTEN)
target_link_libraries(supertux2_lib PUBLIC LibSDL2 LibSDL2_image)
endif()
-target_link_libraries(supertux2_lib PUBLIC LibSDL2_ttf)
target_link_libraries(supertux2_lib PUBLIC LibSquirrel)
target_link_libraries(supertux2_lib PUBLIC LibSqstdlib)
-target_link_libraries(supertux2_lib PUBLIC LibTinygettext)
target_link_libraries(supertux2_lib PUBLIC LibSexp)
-target_link_libraries(supertux2_lib PUBLIC LibSavePNG)
target_link_libraries(supertux2_lib PUBLIC LibPartioZip)
target_link_libraries(supertux2_lib PUBLIC LibOpenAL)
target_link_libraries(supertux2_lib PUBLIC LibOggVorbis)
diff --git a/mk/cmake/SuperTux/ProvideSDL2.cmake b/mk/cmake/SuperTux/ProvideSDL2.cmake
index 902b4a9..81731f4 100644
--- a/mk/cmake/SuperTux/ProvideSDL2.cmake
+++ b/mk/cmake/SuperTux/ProvideSDL2.cmake
@@ -1,5 +1,5 @@
message(STATUS "Checking for SDL2")
-if(WIN32)
+if(MSVC)
if(VCPKG_BUILD)
find_package(SDL2 CONFIG REQUIRED)
find_library(SDL2IMAGE_LIBRARIES SDL2_image) |
Beta Was this translation helpful? Give feedback.
Here is the changes required to compile supertux main branch with mingw toolchain.
Click here to see the diff