[CMake] -DCMAKE_BUILD_TYPE=Release breaks build process

Bernhard Seckinger bernhard.seckinger at gmx.de
Thu Mar 2 04:12:39 EST 2017


Hi all,

I'm relatively new to cmake and tried to use it for one of my projects.
Meanwhile I've got a working version, but when I try to build with
-DCMAKE_BUILD_TYPE=Release the linker complains about missing functions.

I guess, that this happens, because all the files are compiled separately and
-O3 removes some functions (or inlines them or whatever). When I compile
manually using -O3, everything works, but in that case I do compilation of
all files and linking in one stroke.

I'm using cmake-d (1), a cmake extension to compile D-files. On my computer
(debian, testing) cmake chooses gdc for compilation which is a D-frontend to
gcc.

I'm quite unsure how I should proceed to make it work. Although I read various
tutorials and stuff about cmake I still feel not like having understood,
what's going on behind the scenes. (What I'm missing is something like the
autotools-guide (2) for cmake.)

Maybe you can give me some ideas on how to proceed?

Berni

PS: And of course, if anyone would like to have a direct look at my
project and give some comments on it, I'd be really happy. You can find it at
github (3).

PPS: I asked a similar question in the D-Forum, but got no answers there,
probably because it's the wrong place to do so...

(1) https://github.com/dcarp/cmake-d
(2)
http://freesoftwaremagazine.com/articles/autotools_a_guide_to_autoconf_automake_libtool/
(3) https://github.com/crocopaw/croco/tree/devel

-- 
-- Meine Rätselwebseite: www.croco-puzzle.com



More information about the CMake mailing list