Skip to content

Instantly share code, notes, and snippets.

@LebedevRI
Created April 30, 2019 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LebedevRI/52c2fee1c14074fbaa09ec3cb0e5e15b to your computer and use it in GitHub Desktop.
Save LebedevRI/52c2fee1c14074fbaa09ec3cb0e5e15b to your computer and use it in GitHub Desktop.
cmake_minimum_required (VERSION 2.8.12)
project (test CXX C)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
add_executable(zzzzzz zzzzzz.cc)
target_link_libraries(zzzzzz Threads::Threads)
$ CC=gcc-8 CXX=g++-8 CFLAGS="-fsanitize=address " CXXFLAGS="-fsanitize=address " cmake ../ && make VERBOSE=1 zzzzzz
/usr/bin/g++-8 -fsanitize=address -o CMakeFiles/zzzzzz.dir/zzzzzz.cc.o -c /home/lebedevri/cmake-bug-pthread/zzzzzz.cc
[100%] Linking CXX executable zzzzzz
/usr/bin/cmake -E cmake_link_script CMakeFiles/zzzzzz.dir/link.txt --verbose=1
/usr/bin/g++-8 -fsanitize=address -rdynamic CMakeFiles/zzzzzz.dir/zzzzzz.cc.o -o zzzzzz
$ CC=gcc-8 CXX=g++-8 cmake ../ && make VERBOSE=1 zzzzzz
[ 50%] Building CXX object CMakeFiles/zzzzzz.dir/zzzzzz.cc.o
/usr/bin/g++-8 -pipe -pthread -o CMakeFiles/zzzzzz.dir/zzzzzz.cc.o -c /home/lebedevri/cmake-bug-pthread/zzzzzz.cc
[100%] Linking CXX executable zzzzzz
/usr/bin/cmake -E cmake_link_script CMakeFiles/zzzzzz.dir/link.txt --verbose=1
/usr/bin/g++-8 -pipe -rdynamic CMakeFiles/zzzzzz.dir/zzzzzz.cc.o -o zzzzzz -pthread
int main() {return 0;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment