fix shared builds on borland and add debug stuff for makefiles
This commit is contained in:
parent
c1c3149d16
commit
26e05fc060
|
@ -1,19 +1,25 @@
|
|||
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||
SET(CMAKE_LINK_LIBRARY_FLAG "")
|
||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-tWR")
|
||||
SET(CMAKE_SHARED_BUILD_CXX_FLAGS "-tWR")
|
||||
|
||||
SET(CMAKE_START_TEMP_FILE "@&&|\n")
|
||||
SET(CMAKE_END_TEMP_FILE "\n|")
|
||||
# uncomment these out to debug makefiles
|
||||
#SET(CMAKE_START_TEMP_FILE "")
|
||||
#SET(CMAKE_END_TEMP_FILE "")
|
||||
#SET(CMAKE_VERBOSE_MAKEFILE 1)
|
||||
# create a shared C++ library
|
||||
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||
"<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD -tWR <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>\n|"
|
||||
"implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.dll\n|"
|
||||
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD -tWR <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>${CMAKE_END_TEMP_FILE}"
|
||||
"implib ${CMAKE_START_TEMP_FILE}-w <TARGET_BASE>.lib <TARGET_BASE>.dll${CMAKE_END_TEMP_FILE}"
|
||||
)
|
||||
|
||||
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
||||
|
||||
# create a C shared library
|
||||
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||
"<CMAKE_C_COMPILER> @&&|\n-e<TARGET> -tWD <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>\n|"
|
||||
"implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.dll\n|"
|
||||
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>${CMAKE_END_TEMP_FILE}"
|
||||
"implib ${CMAKE_START_TEMP_FILE}-w <TARGET_BASE>.lib <TARGET_BASE>.dll${CMAKE_END_TEMP_FILE}"
|
||||
)
|
||||
|
||||
# create a C shared module just copy the shared library rule
|
||||
|
@ -21,26 +27,26 @@ SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
|||
|
||||
|
||||
# create a C++ static library
|
||||
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "tlib @&&|\n/p512 /a <TARGET> <OBJECTS_QUOTED>\n|")
|
||||
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "tlib ${CMAKE_START_TEMP_FILE}/p512 /a <TARGET> <OBJECTS_QUOTED>${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
# create a C static library
|
||||
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
|
||||
|
||||
# compile a C++ file into an object file
|
||||
SET(CMAKE_CXX_COMPILE_OBJECT
|
||||
"<CMAKE_CXX_COMPILER> @&&|\n-DWIN32 -P -o<OBJECT> <FLAGS> -c <SOURCE>\n|")
|
||||
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE}-DWIN32 -P <FLAGS> -o<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
# compile a C file into an object file
|
||||
SET(CMAKE_C_COMPILE_OBJECT
|
||||
"<CMAKE_C_COMPILER> @&&|\n-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>\n|")
|
||||
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
|
||||
SET(CMAKE_C_LINK_EXECUTABLE
|
||||
"<CMAKE_C_COMPILER> @&&|\n-e<TARGET> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> \n|")
|
||||
"<CMAKE_C_COMPILER> &&|\n-e<TARGET> <LINK_FLAGS> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> ${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
|
||||
SET(CMAKE_CXX_LINK_EXECUTABLE
|
||||
"<CMAKE_CXX_COMPILER> @&&|\n -e<TARGET> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> \n|")
|
||||
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} <LINK_FLAGS> -e<TARGET> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> ${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
SET (CMAKE_BUILD_TYPE Debug CACHE STRING
|
||||
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
|
||||
|
|
Loading…
Reference in New Issue