Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove surelog libs out of own folder, use soversion #3828

Merged
merged 2 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,16 @@ endif()
# in .github/workflows/non_vendored.yml

# NOTE: Set the global output directories after the subprojects have had their go at it
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Force all .lib and .dll into bin for windows
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
else()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
endif()

# Python
if (SURELOG_WITH_PYTHON)
Expand Down Expand Up @@ -529,7 +536,10 @@ foreach(gen_src ${surelog_generated_SRC})
endforeach()

add_library(surelog ${surelog_SRC} ${surelog_generated_SRC})
set_target_properties(surelog PROPERTIES PUBLIC_HEADER include/Surelog/surelog.h)
set_target_properties(surelog PROPERTIES
PUBLIC_HEADER include/Surelog/surelog.h
SOVERSION "${SURELOG_VERSION_MAJOR}.${SURELOG_VERSION_MINOR}"
)

configure_file(${PROJECT_SOURCE_DIR}/include/Surelog/config.h.in ${GENDIR}/include/Surelog/config.h)
target_compile_options(surelog PUBLIC
Expand Down Expand Up @@ -807,15 +817,15 @@ endif()
install(
TARGETS surelog
EXPORT Surelog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Surelog)

if(NOT SURELOG_USE_HOST_ANTLR)
install(
TARGETS antlr4_static
EXPORT Surelog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Surelog)
endif()

Expand All @@ -828,20 +838,20 @@ if(NOT SURELOG_USE_HOST_UHDM)
install(
TARGETS capnp kj
EXPORT Surelog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uhdm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uhdm)
endif()
install(
TARGETS uhdm
EXPORT Surelog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uhdm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uhdm)
endif()

if (SURELOG_WITH_PYTHON)
install(
DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python
DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog-python)
endif()

install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/pkg DESTINATION share/surelog)
Expand Down Expand Up @@ -966,13 +976,13 @@ if (WIN32)
FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/surelog.dir/surelog.pdb
${LIBANTLR4_BINARY_DIR}/runtime/$<TARGET_FILE_BASE_NAME:antlr4_static>.pdb
CONFIGURATIONS Debug RelWithDebInfo
DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog)
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
FILES ${UHDM_BINARY_DIR}/CMakeFiles/uhdm.dir/uhdm.pdb
${Cap\'n\ Proto_BINARY_DIR}/src/capnp/CMakeFiles/capnp.dir/capnp.pdb
${Cap\'n\ Proto_BINARY_DIR}/src/kj/CMakeFiles/kj.dir/kj.pdb
CONFIGURATIONS Debug RelWithDebInfo
DESTINATION ${CMAKE_INSTALL_LIBDIR}/uhdm)
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,5 @@ test_install_pkgconfig:

uninstall:
$(RM) -r $(PREFIX)/bin/surelog
$(RM) -r $(PREFIX)/lib/surelog
$(RM) -r $(PREFIX)/lib/libsurelog*
$(RM) -r $(PREFIX)/include/Surelog
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ or
or
make release_with_python

make install (/usr/local/bin and /usr/local/lib/surelog by default,
make install (/usr/local/bin and /usr/local/lib by default,
use PREFIX= for alternative location)
```

Expand Down Expand Up @@ -250,15 +250,15 @@ target_link_libraries(<your project name> surelog)
* By default Surelog does not build the Python API, See [`src/README`](src/README.md)
* The Python API is operating on the Preprocessor and Parser ASTs. It is not supporting elaboration. Post-elaborated API seekers need to the use UHDM C/C++ API.
* The file [`slformatmsg.py`](src/API/slformatmsg.py) illustrates how messages can be reformated.
* Place a modified version of this file either in the execution directory, or install directory /usr/local/lib/surelog/python
* Place a modified version of this file either in the execution directory, or install directory /usr/local/lib/surelog-python

* A simple example of creating a new error message and generating errors can be found here: [`python_listener.py`](src/API/python_listener.py)

* A simple example for design-level data model exploration can be found here: [`myscriptPerDesign.py`](tests/UnitPython/myscriptPerDesign.py)

* The complete Python API is described in the following files: [`SLAPI.h`](src/API/SLAPI.h) [`vobjecttypes`](src/API/vobjecttypes.py)

* Waivers can be installed in slwaivers.py files in the execution directory or install directory /usr/local/lib/surelog/python
* Waivers can be installed in slwaivers.py files in the execution directory or install directory /usr/local/lib/surelog-python

### Large design compilation on Linux
* It is recommanded to use the -lowmem -mp <nb processor> options in conjunction for large designs.
Expand Down
2 changes: 1 addition & 1 deletion cmake/configs/Surelog.pc.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix="${prefix}"
libdir="@CMAKE_INSTALL_FULL_LIBDIR@/surelog"
libdir="@CMAKE_INSTALL_FULL_LIBDIR@"
includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@"

Name: @PROJECT_NAME@
Expand Down
2 changes: 1 addition & 1 deletion cmake/configs/SurelogConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/SurelogTargets.cmake)
set_and_check(SURELOG_BIN_DIR @CMAKE_INSTALL_FULL_BINDIR@)
set_and_check(SURELOG_INCLUDE_DIR @CMAKE_INSTALL_FULL_INCLUDEDIR@)
set_and_check(SURELOG_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)
set_and_check(SURELOG_LIB_DIR @CMAKE_INSTALL_FULL_LIBDIR@/surelog)
set_and_check(SURELOG_LIB_DIR @CMAKE_INSTALL_FULL_LIBDIR@)

check_required_components(Surelog)
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ make
or
make debug

make install (/usr/local/bin and /usr/local/lib/surelog by default, use PREFIX=<path> for alternative locations)
make install (/usr/local/bin and /usr/local/lib by default, use PREFIX=<path> for alternative locations)

To make with Python you have to add the option to build/cmake: -DSURELOG_WITH_PYTHON=1
```
Expand Down
Loading