Skip to content

Commit

Permalink
i#3458 cpp pre-processor: Allow users to override default CPP at buil…
Browse files Browse the repository at this point in the history
…d time (#3532)

This change is required for the stock OpenSUSE
Tumbleweed distro on AArch64
  • Loading branch information
AssadHashmi authored Apr 12, 2019
1 parent 053f6b6 commit 09c690b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions make/cpp2asm_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,15 @@ if (UNIX)
# and doesn't produce any output, so we must use cpp for our .asm files.
# we assume it's in the same dir.
get_filename_component(compiler_path ${CMAKE_C_COMPILER} PATH)
find_program(CMAKE_CPP cpp HINTS "${compiler_path}" DOC "path to C preprocessor")
if (NOT CMAKE_CPP)
message(FATAL_ERROR "cpp is required to build")
endif (NOT CMAKE_CPP)
# Allow user to set C pre-processor from environment variable
if (DEFINED ENV{CPP})
set(CMAKE_CPP $ENV{CPP})
else ()
find_program(CMAKE_CPP cpp HINTS "${compiler_path}" DOC "path to C preprocessor")
if (NOT CMAKE_CPP)
message(FATAL_ERROR "cpp is required to build")
endif (NOT CMAKE_CPP)
endif ()
mark_as_advanced(CMAKE_CPP)

set(CPP_KEEP_COMMENTS -C)
Expand Down

0 comments on commit 09c690b

Please sign in to comment.