diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-03-08 21:25:30 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-03-08 21:25:30 +0000 |
| commit | 0ae428950e2a20ead42222f9f4752193fa7691c6 (patch) | |
| tree | 4abd1a110b4a680ff6941cdca32aad89f11ad324 | |
| parent | Apply the Albin Penner fix for bug 1663362 (diff) | |
| download | inkscape-0ae428950e2a20ead42222f9f4752193fa7691c6.tar.gz inkscape-0ae428950e2a20ead42222f9f4752193fa7691c6.zip | |
CMake: Assume mingw-w64 for MinGW builds
(should be a safe assumption, if not let me know...)
This resolves the "mingw-w64" vs. "MinGW 64-bit" ambiguity of the "HAVE_MINGW64" cmake variable (which worked before as devlibs = 32bit = mingw; devlibs64 = 64-bit = mingw-w64), but is not senseful for newer 32-bit MinGW builds that are based on mingw-w64, too.
(bzr r15579)
| -rw-r--r-- | CMakeLists.txt | 4 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 11 | ||||
| -rw-r--r-- | mingwenv.cmake | 37 |
3 files changed, 19 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f6921ed4..b2aab26c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,12 +310,12 @@ message("HAVE_MINGW64: ${HAVE_MINGW64}") message("MINGW_PATH: ${MINGW_PATH}") message("MINGW_ARCH: ${MINGW_ARCH}") message("MINGW_ARCH_PATH: ${MINGW_ARCH_PATH}") -message("MINGW64_INCLUDE: ${MINGW64_INCLUDE}") -message("MINGW64_LIB: ${MINGW64_LIB}") +if(NOT HAVE_MSYS2) message("DEVLIBS_PATH: ${DEVLIBS_PATH}") message("DEVLIBS_LIB: ${DEVLIBS_LIB}") message("DEVLIBS_BIN: ${DEVLIBS_BIN}") message("PKG_CONFIG_PATH: ${PKG_CONFIG_PATH}") endif() +endif() message("------------------------------------------------------------------------") diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 90df50c6d..29ccb3a91 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -23,21 +23,16 @@ list(APPEND INKSCAPE_CXX_FLAGS "-std=c++11") if(WIN32) # Set the link and include directories get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) - - # MinGW supplied STL does not define these floating point constants.. :/ - add_definitions(-DFLT_EPSILON=1e-9) - add_definitions(-DFLT_MAX=1e+37) - add_definitions(-DFLT_MIN=1e-37) list(APPEND INKSCAPE_LIBS "-lmscms") list(APPEND INKSCAPE_CXX_FLAGS "-mwindows") list(APPEND INKSCAPE_CXX_FLAGS "-mthreads") + + list(APPEND INKSCAPE_LIBS "-lgomp") + list(APPEND INKSCAPE_LIBS "-lwinpthread") if(HAVE_MINGW64) - list(APPEND INKSCAPE_LIBS "-lgomp") - list(APPEND INKSCAPE_LIBS "-lwinpthread") - list(APPEND INKSCAPE_CXX_FLAGS "-m64") else() list(APPEND INKSCAPE_CXX_FLAGS "-m32") diff --git a/mingwenv.cmake b/mingwenv.cmake index 1cae3a7f7..27de4e5f5 100644 --- a/mingwenv.cmake +++ b/mingwenv.cmake @@ -93,11 +93,8 @@ endif() set(HAVE_MINGW ON)
# Try to determine the MinGW processor architecture.
-if(EXISTS "${MINGW_PATH}/mingw32")
+if(EXISTS "${MINGW_PATH}/i686-w64-mingw32")
set(HAVE_MINGW64 OFF)
- set(MINGW_ARCH mingw32)
-elseif(EXISTS "${MINGW_PATH}/i686-w64-mingw32")
- set(HAVE_MINGW64 ON)
set(MINGW_ARCH i686-w64-mingw32)
elseif(EXISTS "${MINGW_PATH}/x86_64-w64-mingw32")
set(HAVE_MINGW64 ON)
@@ -133,29 +130,27 @@ if(NOT EXISTS ${MINGW_INCLUDE}) message(FATAL_ERROR "MinGW include directory does not exist: ${MINGW_INCLUDE}")
endif()
-# Add general MinGW headers to compiler include path.
+# Add MinGW headers to compiler include path.
include_directories(SYSTEM ${MINGW_INCLUDE})
-if(HAVE_MINGW64)
- set(MINGW64_LIB "${MINGW_ARCH_PATH}/lib")
+set(MINGW_ARCH_LIB "${MINGW_ARCH_PATH}/lib")
- if(NOT EXISTS ${MINGW64_LIB})
- message(FATAL_ERROR "MinGW 64-Bit libraries directory does not exist: ${MINGW64_LIB}")
- endif()
+if(NOT EXISTS ${MINGW_ARCH_LIB})
+ message(FATAL_ERROR "MinGW toolchainlibraries directory does not exist: ${MINGW_ARCH_LIB}")
+endif()
- # Add 64-Bit libraries to linker path.
- link_directories(${MINGW64_LIB})
+# Add MinGW toolchain libraries to linker path.
+link_directories(${MINGW_ARCH_LIB})
- set(MINGW64_INCLUDE "${MINGW_ARCH_PATH}/include")
+set(MINGW_ARCH_INCLUDE "${MINGW_ARCH_PATH}/include")
- if(NOT EXISTS ${MINGW64_INCLUDE})
- message(FATAL_ERROR "MinGW 64-Bit include directory does not exist: ${MINGW64_INCLUDE}")
- endif()
-
- # Add 64-Bit MinGW headers to compiler include path.
- include_directories(${MINGW64_INCLUDE})
+if(NOT EXISTS ${MINGW_ARCH_INCLUDE})
+ message(FATAL_ERROR "MinGW toolchaininclude directory does not exist: ${MINGW_ARCH_INCLUDE}")
endif()
+# Add MinGW toolchain headers to compiler include path.
+include_directories(${MINGW_ARCH_INCLUDE})
+
# -----------------------------------------------------------------------------
# MSYS CHECKS
# -----------------------------------------------------------------------------
@@ -191,7 +186,3 @@ endif() # Tweak CMake into using Unix-style library names.
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll")
-
-if(NOT HAVE_MINGW64)
- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-endif()
\ No newline at end of file |
