summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoseph Ates <joseph.ates@msasafety.com>2016-01-23 06:53:29 -0500
committerAndreas Schneider <asn@cryptomilk.org>2016-02-10 13:26:45 +0100
commit044a1a11f891c1264281992f1a2121fb0856218c (patch)
treea7cf3628f78c79fed16d99a4d57528b43ae87b79 /CMakeLists.txt
parentc35d3edecac0b5e5884f9e26ba9cf73753279ea3 (diff)
downloadcmocka-044a1a11f891c1264281992f1a2121fb0856218c.tar.gz
cmocka-044a1a11f891c1264281992f1a2121fb0856218c.tar.bz2
cmocka-044a1a11f891c1264281992f1a2121fb0856218c.zip
cmake: Add MinGW DLL Prefix Workaround
CMake assigns "lib" as the prefix to shared libraries on MinGW GCC, but MinGW does not expect such a prefix when linking to DLLs. By setting, CMAKE_SHARED_LIBRARY_PREFIX to "" the example tests were able to run with the exception of the calculator_test which segfaults (SIGSEGV) on the setjmp in test_divide_by_zero. This fault is specific to MinGW and does not occur within runs on Cygwin or Visual Studio. calculator_test was enabled only for static linking on MinGW Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4507444..478929d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,6 +44,11 @@ macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source buil
include(ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+# MinGW DLL Naming Workaround
+if (MINGW)
+ set(CMAKE_SHARED_LIBRARY_PREFIX "")
+endif (MINGW)
+
# check subdirectories
add_subdirectory(doc)
add_subdirectory(include)