Skip to content

Commit

Permalink
bug fix: allow (as intended) CMake specified VERILATOR_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
JoGei committed Jan 16, 2024
1 parent c32f160 commit bc6aa7b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmake/FindVERILATOR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
# limitations under the License.
####################################################################################################

if(NOT IS_DIRECTORY $ENV{VERILATOR_ROOT})
message(FATAL_ERROR "Set VERILATOR_ROOT environment variable!")
if(NOT VERILATOR_ROOT)
message(WARNING "VERILATOR_ROOT not set by CMake. Trying environment...")
set(VERILATOR_ROOT $ENV{VERILATOR_ROOT})
endif()
if(NOT VERILATOR_ROOT)
message(FATAL_ERROR "Please specify VERILATOR_ROOT in environment or CMake CL.")
else()
message(STATUS "VERILATOR_ROOT: ${VERILATOR_ROOT}")
endif()

set(VERILATOR_ROOT $ENV{VERILATOR_ROOT})
message(STATUS "VERILATOR_ROOT: ${VERILATOR_ROOT}")

if(EXISTS "${VERILATOR_ROOT}/Makefile")
# This is a non-install Verilator, aka repository+build
Expand Down

0 comments on commit bc6aa7b

Please sign in to comment.