Windows fixes for gdc and phobos
This commit is contained in:
parent
69f0cfbaba
commit
1c00666500
3 changed files with 68 additions and 52 deletions
|
@ -1,45 +1,45 @@
|
|||
#
|
||||
# CMakeD - CMake module for D Language
|
||||
#
|
||||
# Copyright (c) 2007, Selman Ulug <selman.ulug@gmail.com>
|
||||
# Tim Burrell <tim.burrell@gmail.com>
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# See Copyright.txt for details.
|
||||
#
|
||||
# Modified from CMake 2.6.5 CMakeCCompiler.cmake.in
|
||||
# See http://www.cmake.org/HTML/Copyright.html for details
|
||||
#
|
||||
|
||||
SET(CMAKE_D_COMPILER "@CMAKE_D_COMPILER@")
|
||||
SET(CMAKE_D_COMPILER_ARG1 "@CMAKE_D_COMPILER_ARG1@")
|
||||
SET(CMAKE_AR "@CMAKE_AR@")
|
||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||
SET(CMAKE_COMPILER_IS_GDC @CMAKE_COMPILER_IS_GDC@)
|
||||
SET(CMAKE_COMPILER_IS_DMD @CMAKE_COMPILER_IS_DMD@)
|
||||
SET(CMAKE_D_COMPILER_LOADED 1)
|
||||
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
||||
SET(CYGWIN 1)
|
||||
SET(UNIX 1)
|
||||
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
|
||||
|
||||
SET(CMAKE_D_COMPILER_ENV_VAR "DC")
|
||||
|
||||
IF(CMAKE_COMPILER_IS_MINGW)
|
||||
SET(MINGW 1)
|
||||
ENDIF(CMAKE_COMPILER_IS_MINGW)
|
||||
SET(CMAKE_COMPILER_IS_GDC_RUN 1)
|
||||
SET(CMAKE_D_SOURCE_FILE_EXTENSIONS d)
|
||||
SET(CMAKE_D_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
SET(CMAKE_D_LINKER_PREFERENCE None)
|
||||
IF(UNIX)
|
||||
SET(CMAKE_D_OUTPUT_EXTENSION .o)
|
||||
ELSE(UNIX)
|
||||
SET(CMAKE_D_OUTPUT_EXTENSION .obj)
|
||||
ENDIF(UNIX)
|
||||
# save the size of void* in case where cache is removed
|
||||
# and the this file is still around
|
||||
#SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
|
||||
#
|
||||
# CMakeD - CMake module for D Language
|
||||
#
|
||||
# Copyright (c) 2007, Selman Ulug <selman.ulug@gmail.com>
|
||||
# Tim Burrell <tim.burrell@gmail.com>
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# See Copyright.txt for details.
|
||||
#
|
||||
# Modified from CMake 2.6.5 CMakeCCompiler.cmake.in
|
||||
# See http://www.cmake.org/HTML/Copyright.html for details
|
||||
#
|
||||
|
||||
SET(CMAKE_D_COMPILER "@CMAKE_D_COMPILER@")
|
||||
SET(CMAKE_D_COMPILER_ARG1 "@CMAKE_D_COMPILER_ARG1@")
|
||||
SET(CMAKE_AR "@CMAKE_AR@")
|
||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||
SET(CMAKE_COMPILER_IS_GDC @CMAKE_COMPILER_IS_GDC@)
|
||||
SET(CMAKE_COMPILER_IS_DMD @CMAKE_COMPILER_IS_DMD@)
|
||||
SET(CMAKE_D_COMPILER_LOADED 1)
|
||||
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
||||
SET(CYGWIN 1)
|
||||
SET(UNIX 1)
|
||||
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
|
||||
|
||||
SET(CMAKE_D_COMPILER_ENV_VAR "DC")
|
||||
|
||||
IF(CMAKE_COMPILER_IS_MINGW)
|
||||
SET(MINGW 1)
|
||||
ENDIF(CMAKE_COMPILER_IS_MINGW)
|
||||
SET(CMAKE_COMPILER_IS_GDC_RUN 1)
|
||||
SET(CMAKE_D_SOURCE_FILE_EXTENSIONS d)
|
||||
SET(CMAKE_D_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
SET(CMAKE_D_LINKER_PREFERENCE None)
|
||||
IF(UNIX)
|
||||
SET(CMAKE_D_OUTPUT_EXTENSION .o)
|
||||
ELSE(UNIX)
|
||||
SET(CMAKE_D_OUTPUT_EXTENSION .obj)
|
||||
ENDIF(UNIX)
|
||||
# save the size of void* in case where cache is removed
|
||||
# and the this file is still around
|
||||
#SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
|
||||
|
|
|
@ -153,7 +153,7 @@ ENDIF(CMAKE_D_USE_TANGO)
|
|||
IF(CMAKE_D_USE_PHOBOS)
|
||||
IF(CMAKE_COMPILER_IS_GDC)
|
||||
SET(DSTDLIB_TYPE "-fversion=Phobos")
|
||||
SET(DSTDLIB_FLAGS "-lphobos -version=Phobos")
|
||||
SET(DSTDLIB_FLAGS "-lgphobos")
|
||||
ELSE(CMAKE_COMPILER_IS_GDC)
|
||||
SET(DSTDLIB_TYPE "-version=Phobos")
|
||||
SET(DSTDLIB_FLAGS "-L${D_PATH}/lib -ltango -lphobos")
|
||||
|
@ -179,9 +179,19 @@ ENDIF(NOT CMAKE_D_CREATE_SHARED_MODULE)
|
|||
# create a D static library
|
||||
IF(NOT CMAKE_D_CREATE_STATIC_LIBRARY)
|
||||
IF(CMAKE_COMPILER_IS_GDC)
|
||||
SET(CMAKE_D_CREATE_STATIC_LIBRARY
|
||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||
"<CMAKE_RANLIB> <TARGET> ")
|
||||
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
SET(CMAKE_D_CREATE_STATIC_LIBRARY
|
||||
"<CMAKE_AR> cr <TARGET>.lib <LINK_FLAGS> <OBJECTS> "
|
||||
"<CMAKE_RANLIB> <TARGET>.lib "
|
||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||
"<CMAKE_RANLIB> <TARGET> "
|
||||
)
|
||||
ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
SET(CMAKE_D_CREATE_STATIC_LIBRARY
|
||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||
"<CMAKE_RANLIB> <TARGET> "
|
||||
)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
ELSE(CMAKE_COMPILER_IS_GDC)
|
||||
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
SET(CMAKE_D_CREATE_STATIC_LIBRARY
|
||||
|
|
|
@ -80,9 +80,15 @@ IF(NOT CMAKE_D_PHOBOS_WORKS)
|
|||
"int main(char[][] args)\n"
|
||||
"{ writefln(\"%s\", args[0]); return args.sizeof-1;}\n")
|
||||
IF(CMAKE_COMPILER_IS_GDC)
|
||||
TRY_COMPILE(CMAKE_D_PHOBOS_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
CMAKE_FLAGS "-DLINK_LIBRARIES=gphobos"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
TRY_COMPILE(CMAKE_D_PHOBOS_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
#CMAKE_FLAGS "-DLINK_LIBRARIES=gphobos"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
TRY_COMPILE(CMAKE_D_PHOBOS_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
CMAKE_FLAGS "-DLINK_LIBRARIES=gphobos"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
ELSE(CMAKE_COMPILER_IS_GDC)
|
||||
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
TRY_COMPILE(CMAKE_D_PHOBOS_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
|
|
Loading…
Reference in a new issue