Created
September 10, 2017 10:19
-
-
Save bolry/5f957b3b9e7d92d685841fde1e677369 to your computer and use it in GitHub Desktop.
CMake stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example of settings to CMake I use | |
Overrides RelWithDebugInfo from '-O2' to '-Og' | |
Also sets TYPE to 'Debug' | |
And example of setting the Eclipse executable path. | |
alias ncmake='CXX=g++ CC=gcc cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-Og -g -DNDEBUG" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-Og -g -DNDEBUG" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-v -DCMAKE_ECLIPSE_EXECUTABLE=/home/bo/eclipse/cpp-mars/eclipse/eclipse -DCMAKE_ECLIPSE_VERSION:STRING="4.5 (Mars)" -G "Eclipse CDT4 - Ninja"' |
Google Test and CMake automatic
https://crascit.com/2015/07/25/cmake-gtest/
From http://www.bitsnbites.eu/faster-c-builds/
Using gold:
if (UNIX AND NOT APPLE)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
if ("${ld_version}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
endif()
endif()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modern C++ CI 2017-07-01
https://juan-medina.com/2017/07/01/moderncppci/