OpenSTA icon indicating copy to clipboard operation
OpenSTA copied to clipboard

CMakeFile generates StaConfig.hh in source tree instead of build tree

Open hzeller opened this issue 9 months ago • 2 comments

The CMake file in sta generates its config in STA_HOME instead of CMAKE_CURRENT_BINARY_DIR.

Because of that, if cmake is run and then bazel is run, the compiler finds the wrong StaConfig.hh and complains about tclreadline not found (because that is not compiled into the bazel build yet). The bazel build generates its own version, but because the cmake configure creates that in the wrong place, it will mess up things.

So what I believe should be done is:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -392,7 +392,7 @@ message(STATUS "SSTA: ${SSTA}")
 
 # configure a header file to pass some of the CMake settings
 configure_file(${STA_HOME}/util/StaConfig.hh.cmake
-  ${STA_HOME}/include/sta/StaConfig.hh
+  ${CMAKE_CURRENT_BINARY_DIR}/include/sta/StaConfig.hh
   )
 
 ###########################################################

hzeller avatar Apr 04 '25 04:04 hzeller

More comprehensive fix in https://github.com/parallaxsw/OpenSTA/pull/230

hzeller avatar Apr 17 '25 19:04 hzeller

Fixed upstream.

hzeller avatar Apr 25 '25 15:04 hzeller