Skip to content

UnitTest++ not compiling with PGI compiler #153

Open

Description

@mmoelle1

Dear John,

UnitTest++ does not compile why the PGI compiler (latest Community edition) under Linux due to the following reason. In the CMakeLists.txt file at line 36 you define
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
which works well for Clang and GNU but is unsupported by the PGI compiler. I suggest to add

# up warning level for project
if (${UTPP_AMPLIFY_WARNINGS})
# instead of getting compiler specific, we're going to try making an assumption that an existing /W
# means
# we are dealing with an MSVC or MSVC-like compiler (e.g. Intel on Windows)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "PGI")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()
endif()

Best regards,
Matthias

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions