Skip to content

Commit b2c2052

Browse files
Update CMakeLists.txt
1 parent f41ea8c commit b2c2052

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

libs/EXTERNAL/CMakeLists.txt

+17-18
Original file line numberDiff line numberDiff line change
@@ -79,33 +79,32 @@ if (${WITH_PARMYS})
7979
# Synlig integration (manages Surelog and UHDM internally)
8080

8181
# Synlig integration (manages Surelog and UHDM internally)
82-
set(SYNLIG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/synlig)
82+
set(SYNLIG_PREFIX_DIR "${CMAKE_BINARY_DIR}/synlig") # Ensure paths are correct
83+
set(SYNLIG_SOURCE_DIR "${SYNLIG_PREFIX_DIR}/src/synlig") # Adjust source dir to match ExternalProject behavior
8384

8485
# Clone Synlig repository and ensure submodules are synced before building
8586
ExternalProject_Add(synlig
86-
PREFIX "synlig"
87+
PREFIX ${SYNLIG_PREFIX_DIR}
8788

8889
# Clone the Synlig repository
8990
GIT_REPOSITORY https://github.com/chipsalliance/synlig.git
9091
GIT_TAG main
9192
GIT_PROGRESS TRUE
9293
GIT_SHALLOW TRUE
93-
94-
# Set source and build directories
94+
95+
# Set the correct source directory
9596
SOURCE_DIR "${SYNLIG_SOURCE_DIR}"
9697
BUILD_IN_SOURCE FALSE
97-
INSTALL_DIR " "
98-
99-
# Sync submodules after cloning
100-
101-
102-
UPDATE_COMMAND git submodule update --init --recursive third_party/surelog
103-
WORKING_DIRECTORY ${SYNLIG_SOURCE_DIR}
104-
105-
BUILD_COMMAND ${MAKE_PROGRAM} -C ${SYNLIG_SOURCE_DIR} install DESTDIR=${CMAKE_BINARY_DIR}/bin/synlig_install -j${PROCESSOR_COUNT}
98+
INSTALL_DIR "${CMAKE_BINARY_DIR}/synlig_install"
99+
100+
# Disable submodule update command (not needed, since it's included in cloning)
101+
UPDATE_COMMAND ""
102+
103+
# Ensure build directory exists before building
104+
BUILD_COMMAND ${MAKE_PROGRAM} -C ${SYNLIG_SOURCE_DIR} install DESTDIR=${CMAKE_BINARY_DIR}/synlig_install -j${PROCESSOR_COUNT}
106105
INSTALL_COMMAND ""
107106
CONFIGURE_COMMAND ""
108-
107+
109108
# Pass necessary paths and set environment variables
110109
CMAKE_CACHE_ARGS
111110
"-DCMAKE_BUILD_TYPE:STRING=Release"
@@ -114,15 +113,15 @@ if (${WITH_PARMYS})
114113
"-DUHDM_INSTALL_DIR=${CMAKE_BINARY_DIR}"
115114
"-DBUILD_DIR=${CMAKE_BINARY_DIR}/synlig-build"
116115
"-DEXPORT_PATH=${CMAKE_BINARY_DIR}/synlig_install/usr/local/bin:$ENV{PATH}"
117-
116+
118117
LOG_BUILD ON
119118
LOG_UPDATE ON
120119
LOG_INSTALL ON
121120
LOG_CONFIGURE OFF
122121
LOG_OUTPUT_ON_FAILURE ON
123-
122+
124123
# Ensure dependencies like Yosys are built first
125-
DEPENDS yosys # Ensure submodule sync runs before synlig build
124+
DEPENDS yosys
126125
)
127126

128127
endif ()
@@ -175,4 +174,4 @@ if (VPR_USE_SERVER)
175174
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/sockpp/include>
176175
$<INSTALL_INTERFACE:include>
177176
)
178-
endif()
177+
endif()

0 commit comments

Comments
 (0)