aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-04-02 21:01:58 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-04-02 21:14:30 +0300
commit2cd5addc0c6d5712d4c365101338bfc10ab71615 (patch)
tree3fa5aa6641c2581cb9d7480c890ca9ddb5dca3f4 /src
parent5bf06efb2a211c1e6727744937d009218671a059 (diff)
downloadminetest-2cd5addc0c6d5712d4c365101338bfc10ab71615.tar.gz
minetest-2cd5addc0c6d5712d4c365101338bfc10ab71615.tar.bz2
minetest-2cd5addc0c6d5712d4c365101338bfc10ab71615.zip
Fix things for cross-compiling using mingw
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt25
-rw-r--r--src/winresource.rc6
2 files changed, 17 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 56da7bd07..261c8eeca 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -67,7 +67,7 @@ endif(ENABLE_SOUND AND BUILD_CLIENT)
if(SOUND_PROBLEM)
message(FATAL_ERROR "Sound enabled, but cannot be used.\n"
- "To continue, either fill in the required paths or disable sound.")
+ "To continue, either fill in the required paths or disable sound. (-DENABLE_SOUND=0)")
endif()
if(USE_SOUND)
set(sound_SRCS sound_openal.cpp)
@@ -205,14 +205,19 @@ set(common_SRCS
# This gives us the icon
if(WIN32)
+ set(WINRESOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc)
if(MINGW)
+ if(NOT CMAKE_RC_COMPILER)
+ set(CMAKE_RC_COMPILER "windres.exe")
+ endif()
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
- COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR}
- -i${CMAKE_CURRENT_SOURCE_DIR}/winresource.rc
- -o ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
+ COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR}
+ -i${WINRESOURCE_FILE}
+ -o ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
SET(common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
else(MINGW) # Probably MSVC
- set(common_SRCS ${common_SRCS} winresource.rc)
+ set(common_SRCS ${common_SRCS} ${WINRESOURCE_FILE})
endif(MINGW)
endif()
@@ -348,14 +353,18 @@ else()
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable")
endif(HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
endif()
-
+
+ if(MINGW)
+ set(OTHER_FLAGS "-mthreads -fexceptions")
+ endif()
+
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES i386 CACHE STRING "do not build for 64-bit" FORCE)
set(ARCH i386)
endif()
- set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops")
- set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}")
if(USE_GPROF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
diff --git a/src/winresource.rc b/src/winresource.rc
deleted file mode 100644
index 4770c87b4..000000000
--- a/src/winresource.rc
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <windows.h>
-#include <commctrl.h>
-#include <richedit.h>
-LANGUAGE 0, SUBLANG_NEUTRAL
-130 ICON "..\\misc\\minetest-icon.ico"
-//131 BITMAP "..\\misc\\minetest-icon.bmp"