Mercurial > projects > qtd
comparison cmake/FindD.cmake @ 273:2161595da42b
Unittest flags.
author | SokoL_SD |
---|---|
date | Mon, 28 Sep 2009 05:20:16 +0000 |
parents | 2d061b52e077 |
children | f5606687c578 |
comparison
equal
deleted
inserted
replaced
272:7243f9ed2307 | 273:2161595da42b |
---|---|
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) | 78 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} -d-debug) |
79 set(D_VERSION_FLAG -d-version) | |
79 else(D_IS_LLVM) | 80 else(D_IS_LLVM) |
80 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -inline) | 81 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -inline) |
81 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} -debug) | 82 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} -debug) |
83 set(D_VERSION_FLAG -version) | |
82 endif(D_IS_LLVM) | 84 endif(D_IS_LLVM) |
83 if(CMAKE_HOST_WIN32) | 85 if(CMAKE_HOST_WIN32) |
84 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -L/subsystem:windows) | 86 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -L/subsystem:windows) |
85 endif(CMAKE_HOST_WIN32) | 87 endif(CMAKE_HOST_WIN32) |
86 | 88 |
89 # Unittest flags. | |
90 option(UNITTEST "Includes unittests" "OFF") | |
91 if(UNITTEST) | |
92 set(D_FLAGS ${D_FLAGS} -unittest) | |
93 endif(UNITTEST) | |
87 | 94 |
88 ## Settings. | 95 ## Settings. |
89 if(CMAKE_HOST_WIN32) | 96 if(CMAKE_HOST_WIN32) |
90 set(D_OBJECT_SUFFIX .obj) | 97 set(D_OBJECT_SUFFIX .obj) |
91 if(D_IS_MARS) | 98 if(D_IS_MARS) |
102 endif(CMAKE_HOST_WIN32) | 109 endif(CMAKE_HOST_WIN32) |
103 | 110 |
104 ##-------------------------------------------- | 111 ##-------------------------------------------- |
105 ## Macros and functions. | 112 ## Macros and functions. |
106 ##-------------------------------------------- | 113 ##-------------------------------------------- |
114 | |
115 macro(add_d_versions) | |
116 foreach(arg_tmp ${ARGN}) | |
117 set(D_FLAGS ${D_FLAGS} ${D_VERSION_FLAG}=${arg_tmp}) | |
118 endforeach(arg_tmp ${ARGN}) | |
119 endmacro(add_d_versions) | |
107 | 120 |
108 ## Make a native path. | 121 ## Make a native path. |
109 ## Usage: | 122 ## Usage: |
110 ## set(path c:/file_path/file_name.cpp) | 123 ## set(path c:/file_path/file_name.cpp) |
111 ## make_native_path(path) | 124 ## make_native_path(path) |
207 DEPENDS ${d_source_p} ${depends_tmp} | 220 DEPENDS ${d_source_p} ${depends_tmp} |
208 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | 221 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
209 ) | 222 ) |
210 endforeach (d_source_p_tmp ${SOURCES_tmp}) | 223 endforeach (d_source_p_tmp ${SOURCES_tmp}) |
211 else(NOT SINGLE_D_OBJECT) | 224 else(NOT SINGLE_D_OBJECT) |
225 if(is_ldc) | |
226 set(FLAGS_tmp ${FLAGS_tmp} -oq ) | |
227 endif(is_ldc) | |
212 set(count_objects_tmp 0) | 228 set(count_objects_tmp 0) |
213 set(files${count_objects_tmp}_tmp ) | 229 set(files${count_objects_tmp}_tmp ) |
214 set(counter_tmp 0) | 230 set(counter_tmp 0) |
215 set(files_tmp ) | 231 set(files_tmp ) |
216 set(objects_tmp ) | 232 set(objects_tmp ) |