Browse Source

Fix mingw build

Cloud Wu 5 years ago
parent
commit
5ea018352f
2 changed files with 10 additions and 0 deletions
  1. 8 0
      CMakeLists.txt
  2. 2 0
      Samples/shell/include/win32/IncludeWindows.h

+ 8 - 0
CMakeLists.txt

@@ -171,6 +171,10 @@ if(NO_FONT_INTERFACE_DEFAULT)
 	add_definitions(-DRMLUI_NO_FONT_INTERFACE_DEFAULT)
 endif()
 
+if (WIN32)
+	add_definitions(-DWIN32)
+endif(WIN32)
+
 if(NOT BUILD_SHARED_LIBS)
 	add_definitions(-DRMLUI_STATIC_LIB)
 	message("-- Building static libraries. Make sure to #define RMLUI_STATIC_LIB before including RmlUi in your project.")
@@ -447,6 +451,10 @@ macro(bl_sample NAME)
 	endif()
 
 	target_link_libraries(${NAME} ${ARGN})
+
+	if (WIN32)
+		target_link_libraries(${NAME} shlwapi)
+	endif()
 endmacro()
 
 if(BUILD_SAMPLES)

+ 2 - 0
Samples/shell/include/win32/IncludeWindows.h

@@ -36,7 +36,9 @@
 #define UNICODE
 #define _UNICODE
 #define WIN32_LEAN_AND_MEAN
+#ifndef NOMINMAX
 #define NOMINMAX
+#endif
 
 #include <windows.h>