comparison cmake/FindD.cmake @ 274:f5606687c578

VERBOSE_DEBUG flag
author SokoL_SD
date Mon, 28 Sep 2009 05:32:25 +0000
parents 2161595da42b
children bb0f228c27cd
comparison
equal deleted inserted replaced
273:2161595da42b 274:f5606687c578
73 ## TODO: Add another targets. 73 ## TODO: Add another targets.
74 set(D_RELEASE_FLAGS -O -release) 74 set(D_RELEASE_FLAGS -O -release)
75 set(D_DEBUG_FLAGS -g ) 75 set(D_DEBUG_FLAGS -g )
76 if(D_IS_LLVM) 76 if(D_IS_LLVM)
77 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -enable-inlining) 77 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -enable-inlining)
78 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} -d-debug)
79 set(D_VERSION_FLAG -d-version) 78 set(D_VERSION_FLAG -d-version)
79 set(D_DEBUG_FLAG -d-debug)
80 else(D_IS_LLVM) 80 else(D_IS_LLVM)
81 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -inline) 81 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -inline)
82 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} -debug)
83 set(D_VERSION_FLAG -version) 82 set(D_VERSION_FLAG -version)
83 set(D_DEBUG_FLAG -debug)
84 endif(D_IS_LLVM) 84 endif(D_IS_LLVM)
85 if(CMAKE_HOST_WIN32) 85 if(CMAKE_HOST_WIN32)
86 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -L/subsystem:windows) 86 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -L/subsystem:windows)
87 endif(CMAKE_HOST_WIN32) 87 endif(CMAKE_HOST_WIN32)
88 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} ${D_DEBUG_FLAG})
88 89
89 # Unittest flags. 90 # Unittest flags.
90 option(UNITTEST "Includes unittests" "OFF") 91 option(UNITTEST "Includes unittests" "OFF")
91 if(UNITTEST) 92 if(UNITTEST)
92 set(D_FLAGS ${D_FLAGS} -unittest) 93 set(D_FLAGS ${D_FLAGS} -unittest)
110 111
111 ##-------------------------------------------- 112 ##--------------------------------------------
112 ## Macros and functions. 113 ## Macros and functions.
113 ##-------------------------------------------- 114 ##--------------------------------------------
114 115
116 macro(add_d_flags option)
117 foreach(arg_tmp ${ARGN})
118 set(D_FLAGS ${D_FLAGS} ${option}=${arg_tmp})
119 endforeach(arg_tmp ${ARGN})
120 endmacro(add_d_flags option)
121
115 macro(add_d_versions) 122 macro(add_d_versions)
116 foreach(arg_tmp ${ARGN}) 123 add_d_flags(${D_VERSION_FLAG} ${ARGN})
117 set(D_FLAGS ${D_FLAGS} ${D_VERSION_FLAG}=${arg_tmp})
118 endforeach(arg_tmp ${ARGN})
119 endmacro(add_d_versions) 124 endmacro(add_d_versions)
125
126 macro(add_d_debugs)
127 add_d_flags(${D_DEBUG_FLAG} ${ARGN})
128 endmacro(add_d_debugs)
120 129
121 ## Make a native path. 130 ## Make a native path.
122 ## Usage: 131 ## Usage:
123 ## set(path c:/file_path/file_name.cpp) 132 ## set(path c:/file_path/file_name.cpp)
124 ## make_native_path(path) 133 ## make_native_path(path)
220 DEPENDS ${d_source_p} ${depends_tmp} 229 DEPENDS ${d_source_p} ${depends_tmp}
221 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 230 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
222 ) 231 )
223 endforeach (d_source_p_tmp ${SOURCES_tmp}) 232 endforeach (d_source_p_tmp ${SOURCES_tmp})
224 else(NOT SINGLE_D_OBJECT) 233 else(NOT SINGLE_D_OBJECT)
225 if(is_ldc) 234 if(D_IS_LDC)
226 set(FLAGS_tmp ${FLAGS_tmp} -oq ) 235 set(FLAGS_tmp ${FLAGS_tmp} -oq )
227 endif(is_ldc) 236 endif(D_IS_LDC)
228 set(count_objects_tmp 0) 237 set(count_objects_tmp 0)
229 set(files${count_objects_tmp}_tmp ) 238 set(files${count_objects_tmp}_tmp )
230 set(counter_tmp 0) 239 set(counter_tmp 0)
231 set(files_tmp ) 240 set(files_tmp )
232 set(objects_tmp ) 241 set(objects_tmp )