diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index 89fd6bca5..f974bbd2a 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -159,6 +159,9 @@ macro(process_options) STREQUAL "default" ) set(cmakeBuildType relwithdebinfo) + string(REPLACE "-O2" "-Os" CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" + ) set(CMAKE_CXX_FLAGS_DEFAULT ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) add_definitions(-DNS3_BUILD_PROFILE_DEBUG) elseif(${cmakeBuildType} STREQUAL "release") diff --git a/doc/manual/source/working-with-cmake.rst b/doc/manual/source/working-with-cmake.rst index 9527c0ca4..2d7dc3172 100644 --- a/doc/manual/source/working-with-cmake.rst +++ b/doc/manual/source/working-with-cmake.rst @@ -173,7 +173,7 @@ The mapping of the ``ns3`` build profiles into the CMake build types is the foll +=========================+========================+===============================+=================================+ | debug | debug | | -g | +-------------------------+------------------------+-------------------------------+---------------------------------+ -| default | default | | -O2 -g | +| default | default | | -Os -g | +-------------------------+------------------------+-------------------------------+---------------------------------+ | release | release | | -O3 | +-------------------------+------------------------+-------------------------------+---------------------------------+ @@ -235,9 +235,9 @@ build types and output executable and libraries names, which will receive a suff +==================+===================+ | DEBUG | -g | +------------------+-------------------+ -| DEFAULT | -O2 -g -DNDEBUG | +| DEFAULT | -Os -g -DNDEBUG | +------------------+-------------------+ -| RELWITHDEBINFO | -O2 -g -DNDEBUG | +| RELWITHDEBINFO | -Os -g -DNDEBUG | +------------------+-------------------+ | RELEASE | -O3 -DNDEBUG | +------------------+-------------------+ @@ -1965,7 +1965,7 @@ Installing the packages can take a while, and it can look like it hanged. -- -- Copying /ns-3-dev/cmake-build-release/_deps/armadillo-src/include/ to /ns-3-dev/cmake-build-release/_deps/armadillo-build/tmp/include/ -- Generating /ns-3-dev/cmake-build-release/_deps/armadillo-build/tmp/include/config.hpp - -- CMAKE_CXX_FLAGS = -fsanitize=address,leak,undefined -O2 + -- CMAKE_CXX_FLAGS = -fsanitize=address,leak,undefined -Os -- CMAKE_SHARED_LINKER_FLAGS = -Wl,--no-as-needed -- CMAKE_REQUIRED_INCLUDES = /usr/include;/usr/include/superlu -- diff --git a/doc/tutorial/source/getting-started.rst b/doc/tutorial/source/getting-started.rst index b488bf4c2..136bd2831 100644 --- a/doc/tutorial/source/getting-started.rst +++ b/doc/tutorial/source/getting-started.rst @@ -795,7 +795,7 @@ The build profile controls the use of logging, assertions, and compiler optimiza | Wrapper | | | | | | Macro | | | | | +----------+---------------------------------+-----------------------------+-------------------------------+---------------------------------+ - | Compiler | ``-Og -g`` | ``-O2 -g`` | ``-O3`` | ``-O3`` | + | Compiler | ``-Og -g`` | ``-Os -g`` | ``-O3`` | ``-O3`` | | Flags | | | | ``-march=native`` | | | | | | ``-mtune=native`` | +----------+---------------------------------+-----------------------------+-------------------------------+---------------------------------+