aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-08-10 19:48:53 -0700
committerChris Robinson <[email protected]>2014-08-10 19:48:53 -0700
commit4a9545affaf6873d87fce6768c47dd3518e0f556 (patch)
tree3e6b4f7240fab3daf5300593102b79b2790cef0e
parent6273a18de5798b7e4714f84ec474b6432872e6cb (diff)
Don't try to generate .def or .lib files when building statically
-rw-r--r--CMakeLists.txt38
1 files changed, 20 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b646509f..93732fc2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1048,25 +1048,27 @@ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION}
SOVERSION ${LIB_MAJOR_VERSION})
IF(WIN32 AND NOT LIBTYPE STREQUAL "STATIC")
SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
-ENDIF()
-IF(MINGW AND ALSOFT_BUILD_IMPORT_LIB)
- FIND_PROGRAM(SED_EXECUTABLE NAMES sed DOC "sed executable")
- FIND_PROGRAM(DLLTOOL_EXECUTABLE NAMES "${DLLTOOL}" DOC "dlltool executable")
- IF(NOT SED_EXECUTABLE OR NOT DLLTOOL_EXECUTABLE)
- MESSAGE(STATUS "")
- IF(NOT SED_EXECUTABLE)
- MESSAGE(STATUS "WARNING: Cannot find sed, disabling .def/.lib generation")
- ENDIF()
- IF(NOT DLLTOOL_EXECUTABLE)
- MESSAGE(STATUS "WARNING: Cannot find dlltool, disabling .def/.lib generation")
+
+ IF(MINGW AND ALSOFT_BUILD_IMPORT_LIB)
+ FIND_PROGRAM(SED_EXECUTABLE NAMES sed DOC "sed executable")
+ FIND_PROGRAM(DLLTOOL_EXECUTABLE NAMES "${DLLTOOL}" DOC "dlltool executable")
+ IF(NOT SED_EXECUTABLE OR NOT DLLTOOL_EXECUTABLE)
+ MESSAGE(STATUS "")
+ IF(NOT SED_EXECUTABLE)
+ MESSAGE(STATUS "WARNING: Cannot find sed, disabling .def/.lib generation")
+ ENDIF()
+ IF(NOT DLLTOOL_EXECUTABLE)
+ MESSAGE(STATUS "WARNING: Cannot find dlltool, disabling .def/.lib generation")
+ ENDIF()
+ ELSE()
+ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS "-Wl,--output-def,${LIBNAME}.def")
+ ADD_CUSTOM_COMMAND(TARGET ${LIBNAME} POST_BUILD
+ COMMAND "${SED_EXECUTABLE}" -i -e "s/ @[^ ]*//" ${LIBNAME}.def
+ COMMAND "${DLLTOOL_EXECUTABLE}" -d ${LIBNAME}.def -l ${LIBNAME}.lib -D ${LIBNAME}.dll
+ COMMENT "Stripping ordinals from ${LIBNAME}.def and generating ${LIBNAME}.lib..."
+ VERBATIM
+ )
ENDIF()
- ELSE()
- SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS "-Wl,--output-def,${LIBNAME}.def")
- ADD_CUSTOM_COMMAND(TARGET ${LIBNAME} POST_BUILD
- COMMAND "${SED_EXECUTABLE}" -i -e "s/ @[^ ]*//" ${LIBNAME}.def
- COMMAND "${DLLTOOL_EXECUTABLE}" -d ${LIBNAME}.def -l ${LIBNAME}.lib -D ${LIBNAME}.dll
- COMMENT "Stripping ordinals from ${LIBNAME}.def and generating ${LIBNAME}.lib..."
- VERBATIM)
ENDIF()
ENDIF()