Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default CMake build type #665

Open
dnadlinger opened this issue Jul 5, 2014 · 4 comments
Open

Default CMake build type #665

dnadlinger opened this issue Jul 5, 2014 · 4 comments

Comments

@dnadlinger
Copy link
Member

As reported by @Safety0ff, apparently CMake defaults to some sort of unoptimized build (also see #539 (comment)). I have never stumbled upon this, as LLVM leaks -O3 -fomit-frame-pointer into the llvm-config output, at least when it is built with CMake, thus also enabling optimizations.

We should make sure that we build an optimized version by default if the user specifies no build type. @Safety0ff, could you please post some details on your system config (OS, CMake version, how you built/installed LLVM)?

Note that we might run into trouble if we just set CMAKE_BUILD_TYPE to Release by default, as this defines NDEBUG, which requires a matching LLVM build.

@Trass3r
Copy link
Contributor

Trass3r commented Jul 5, 2014

That problem needs to be solved anyway.
Currently I just undefine NDEBUG locally but a proper solution would be nice.

@Safety0ff
Copy link

RelWithDbgInfo minus NDEBUG would probably be a good choice.
I'm using gentoo with cmake 2.8.12.2 and llvm 3.4.1 (both install via portage.) After git clone'ing ldc I did:

mkdir build && cd build && cmake ..

Which defaults to empty CXX_FLAGS
When writing CMake scripts I usually add a check to see if a variable is unset, then use the default, but only if it is the first configuration run (using a hidden cached variable to mark the end of the first configuration run.)

@Trass3r
Copy link
Contributor

Trass3r commented Jul 6, 2014

Well on Linux RelWithDebInfo results in huge executables and memory consumption during compilation, at least for clang.

@Trass3r
Copy link
Contributor

Trass3r commented Jul 18, 2014

redstar pushed a commit that referenced this issue Sep 27, 2014
Fix cases where goto skips initialization of variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants