Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lestarch: compile options added correctly #956

Merged
merged 6 commits into from
Aug 25, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions cmake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,9 @@ endif()
####
SET(CMAKE_CXX_FLAGS_RELEASE "-std=c++03" CACHE STRING "C++ flags." FORCE)
LeStarch marked this conversation as resolved.
Show resolved Hide resolved
SET(CMAKE_C_FLAGS_RELEASE "-std=c99" CACHE STRING "C flags." FORCE)
# Raise C++ standard to C++11 while unit testing to support googletest
SET(CMAKE_CXX_FLAGS_TESTING "${CMAKE_CXX_FLAGS_TESTING} -std=c++11 -g -DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC= -fprofile-arcs -ftest-coverage"
CACHE STRING "Testing C++ flags." FORCE)
SET(CMAKE_C_FLAGS_TESTING "${CMAKE_C_FLAGS_TESTING} -std=c99 -g -DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC= -fprofile-arcs -ftest-coverage"
CACHE STRING "Testing C flags." FORCE)
SET(CMAKE_EXE_LINKER_FLAGS_TESTING "" CACHE STRING "Testing linker flags." FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_TESTING "" CACHE STRING "Testing linker flags." FORCE)
MARK_AS_ADVANCED(
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE
CMAKE_CXX_FLAGS_TESTING
CMAKE_C_FLAGS_TESTING
CMAKE_EXE_LINKER_FLAGS_TESTING
CMAKE_SHARED_LINKER_FLAGS_TESTING )
# Testing setup for UT and coverage builds
if (CMAKE_BUILD_TYPE STREQUAL "TESTING" )

if (CMAKE_BUILD_TYPE STREQUAL "Testing" OR CMAKE_BUILD_TYPE STREQUAL "TESTING")
add_compile_options("-g" "-DBUILD_UT" "-DPROTECTED=public" "-DPRIVATE=public" "-DSTATIC=" "-fprofile-arcs" "-ftest-coverage")
# These two lines allow for F prime style coverage. They are "unsupported" CMake features, so beware....
set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
Expand Down