aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-07-18 22:58:08 +0200
committerRiccardo Spagni <ric@spagni.net>2015-07-18 22:58:20 +0200
commitd386be640df3912bfd2c2ca652518add1b35cb18 (patch)
tree9f574dd73df4a3b2703de79d201d7113a73f70db /CMakeLists.txt
parentMerge pull request #341 (diff)
parentFixed threadpool bug when running on single core systems. (diff)
downloadmonero-d386be640df3912bfd2c2ca652518add1b35cb18.tar.xz
Merge pull request #342
70ae2ee Fixed threadpool bug when running on single core systems. *Thanks to freshman for reporting bug. (NoodleDoodleNoodleDoodleNoodleDoodleNoo) 464dbe7 Fixed MINGW duplicate library errors when MSYS folder cannot be found. *Thanks to luigi1111 for reporting. (NoodleDoodleNoodleDoodleNoodleDoodleNoo)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e7378a7e..f9e21604f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,16 +159,16 @@ endif()
option(STATIC "Link libraries statically" ${DEFAULT_STATIC})
if(MINGW)
- get_filename_component(msys2_install_path "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS2 ${ARCH_WIDTH}bit;InstallLocation]" ABSOLUTE)
+ string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
+ message(STATUS "MSYS location: ${msys2_install_path}")
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
# This is necessary because otherwise CMake will make Boost libraries -lfoo
# rather than a full path. Unfortunately, this makes the shared libraries get
# linked due to a bug in CMake which misses putting -static flags around the
# -lfoo arguments.
- list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES
- "${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
- list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
- "${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
+ set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib)
+ list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
+ list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
endif()
if(STATIC)