[llvm-commits] [Review request] CMake/MSVS: Support for the target "check"
Óscar Fuentes
ofv at wanadoo.es
Tue Nov 23 07:59:54 PST 2010
Hello Takumi.
NAKAMURA Takumi <geek4civic at gmail.com> writes:
> Good midnight, Oscar.
> Your message is not posted to -commits, is it your intention?
It was posted to -commits:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20101115/111925.html
> I have not tried "MSVC_IDE" yet.
>
> I tried on nmake, but weird nmake doesn't launch tests.
> I won't investigate anything on nmake, it must not be my task! :p
> I would like to give someone tasks for nmake. :)
I use nmake (and JOM, an nmake clone) but don't do testing. The support
for testing on the cmake build was implemented by somebody else. I know
almost nothing about it.
> # imfo: who uses nmake for clang/llvm!
I do. It is really useful. And JOM supports parallel builds on a similar
way that gmake does. When you are working with cmake, for most ordinary
applications you can assume that nmake is just another `make'. Actually,
you need to worry about this two cases when writing cmake scripts that
have to know the exact place where build products are placed: make-based
build systems (build type is known when cmake is invoked) and ide-based
build-systems (build type is selected by the user when the he starts the
build and the output directory depend on that selection).
> I assume;
>
> - ${CMAKE_BUILD_TYPE} should be empty on msvs/vcbuild/msbuild.
> - ${CMAKE_CFG_INTDIR} might be "." on others.
>
> I will rewrite my patch as below similar;
>
> if CMAKE_BUILD_TYPE is not empty
> BUILD_MODE obeys it.
> elsif CMAKE_CFG_INTDIR is not "."
> BUILD_MODE obeys it. (it might be "$(...)")
> else
> warn "Unittests cannot be executed"
> endif
Don't assume that CMAKE_BUILD_TYPE will be empty or not depending on the
tool used for the build (IDE/make). Testing CMAKE_CFG_INTDIR is
safer. So do this:
if( CMAKE_CFG_INTDIR STREQUAL "." )
... Use CMAKE_CFG_INTDIR
else()
... CMAKE_CFG_INTDIR is not required
endif()
Please note that CMAKE_BUILD_TYPE is not needed for knowing the
directory where build products are placed when using make-based build
systems. Always using CMAKE_CFG_INTDIR should be safe, as
tests/CMakeLists.txt already does:
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
That expands to the correct directory when you are using an IDE or a
`make'.
> (excuse me, I cannot refer to cmake reference manual now)
>
>
> ps. I have no darwin hosts. :)
More information about the llvm-commits
mailing list