-- The CXX compiler identification is GNU 10.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- ##### Build type is: Release -- ##### C flags, Debug configuration: -- ##### C flags, Release configuration: -- ##### C flags, Release configuration with Debug info: -- ##### C flags, minimal Release configuration: -- ##### C++ flags, Debug configuration: -g -- ##### C++ flags, Release configuration: -O3 -DNDEBUG -- ##### C++ flags, Release configuration with Debug info: -O2 -g -DNDEBUG -- ##### C++ flags, minimal Release configuration: -Os -DNDEBUG -- Configuring done -- Generating done -- Build files have been written to: /d/Databases/Desktop/cmake/build # 构建 $ cmake --build .
[ 33%] Building CXX object CMakeFiles/hello-world.dir/hello-world.cpp.o [ 66%] Building CXX object CMakeFiles/hello-world.dir/Message.cpp.o [100%] Linking CXX executable hello-world.exe [100%] Built target hello-world $ ls
-- The CXX compiler identification is GNU 10.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- ##### Build type is: Debug -- ##### C flags, Debug configuration: -- ##### C flags, Release configuration: -- ##### C flags, Release configuration with Debug info: -- ##### C flags, minimal Release configuration: -- ##### C++ flags, Debug configuration: -g -- ##### C++ flags, Release configuration: -O3 -DNDEBUG -- ##### C++ flags, Release configuration with Debug info: -O2 -g -DNDEBUG -- ##### C++ flags, minimal Release configuration: -Os -DNDEBUG -- Configuring done -- Generating done -- Build files have been written to: /d/Databases/Desktop/cmake/build $ cmake --build .
[ 33%] Building CXX object CMakeFiles/hello-world.dir/hello-world.cpp.o [ 66%] Building CXX object CMakeFiles/hello-world.dir/Message.cpp.o [100%] Linking CXX executable hello-world.exe [100%] Built target hello-world $ ls
-- The CXX compiler identification is GNU 10.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- ##### Build type is: Release -- ##### C flags, Debug configuration: -- ##### C flags, Release configuration: -- ##### C flags, Release configuration with Debug info: -- ##### C flags, minimal Release configuration: -- ##### C++ flags, Debug configuration: -g -- ##### C++ flags, Release configuration: -O3 -DNDEBUG -- ##### C++ flags, Release configuration with Debug info: -O2 -g -DNDEBUG -- ##### C++ flags, minimal Release configuration: -Os -DNDEBUG -- Configuring done -- Generating done -- Build files have been written to: /d/Databases/Desktop/cmake/build $ cmake --build .
[ 25%] Building CXX object CMakeFiles/message.dir/Message.cpp.o [ 50%] Linking CXX static library libmessage.a [ 50%] Built target message [ 75%] Building CXX object CMakeFiles/hello-world.dir/hello-world.cpp.o [100%] Linking CXX executable hello-world.exe [100%] Built target hello-world # 编译出 libmessage.a $ ls