diff options
author | Andreas Schneider <asn@samba.org> | 2018-09-05 15:38:37 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2018-10-23 15:38:41 +0200 |
commit | 402f548051549edb764184f901e83ee7ece06b29 (patch) | |
tree | 12899fd022f2b218b4223c8795490f31fefb31a0 /cmake | |
parent | 013687b2ccd6c8436e552e6ada2e7f73b8dfd7cd (diff) | |
download | socket_wrapper-402f548051549edb764184f901e83ee7ece06b29.tar.gz socket_wrapper-402f548051549edb764184f901e83ee7ece06b29.tar.xz socket_wrapper-402f548051549edb764184f901e83ee7ece06b29.zip |
cmake: Move Compiler flags to new file
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/AddCMockaTest.cmake | 7 | ||||
-rw-r--r-- | cmake/Modules/DefineCompilerFlags.cmake | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/cmake/Modules/AddCMockaTest.cmake b/cmake/Modules/AddCMockaTest.cmake index b2d1ca8..6a34e76 100644 --- a/cmake/Modules/AddCMockaTest.cmake +++ b/cmake/Modules/AddCMockaTest.cmake @@ -9,13 +9,6 @@ enable_testing() include(CTest) -if(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW) - set(CMAKE_C_FLAGS_PROFILING "-g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wwrite-strings -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Compiler Flags") - set(CMAKE_SHARED_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags") - set(CMAKE_MODULE_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags") - set(CMAKE_EXEC_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags") -endif(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW) - function (ADD_CMOCKA_TEST _testName _testSource) add_executable(${_testName} ${_testSource}) target_link_libraries(${_testName} ${ARGN}) diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake new file mode 100644 index 0000000..4edb6d9 --- /dev/null +++ b/cmake/Modules/DefineCompilerFlags.cmake @@ -0,0 +1,13 @@ +if (UNIX AND NOT WIN32) + # Activate with: -DCMAKE_BUILD_TYPE=Profiling + set(CMAKE_C_FLAGS_PROFILING "-O0 -g -fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the C compiler during PROFILING builds.") + set(CMAKE_CXX_FLAGS_PROFILING "-O0 -g -fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the CXX compiler during PROFILING builds.") + set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the linker during the creation of shared libraries during PROFILING builds.") + set(CMAKE_MODULE_LINKER_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the linker during the creation of shared libraries during PROFILING builds.") + set(CMAKE_EXEC_LINKER_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the linker during PROFILING builds.") +endif() |