Avoid copying all of mathjax, pandoc, and node to the output. Avoid building copies of existing libraries. Link with Guix-provided libraries instead. --- a/src/cpp/session/CMakeLists.txt +++ b/src/cpp/session/CMakeLists.txt @@ -493,18 +493,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../NOTICE ${CMAKE_CURRENT_SOURCE_DIR}/resources COPYONLY) -# configure custom panmirror script into the resources directory -# -# On Linux and Windows builders, found in the tools directory, on Mac and dev -# environments found in the source tree. -set(RSTUDIO_PANMIRROR_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/../../gwt/lib/quarto/packages/editor-server/src/resources/md-writer.lua) -if(NOT EXISTS "${RSTUDIO_PANMIRROR_SCRIPT}") - set(RSTUDIO_PANMIRROR_SCRIPT ${RSTUDIO_TOOLS_ROOT}/../src/gwt/lib/quarto/packages/editor-server/src/resources/md-writer.lua) -endif() -file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources/panmirror-scripts) -configure_file(${RSTUDIO_PANMIRROR_SCRIPT} - ${CMAKE_CURRENT_SOURCE_DIR}/resources/panmirror-scripts/ COPYONLY) - # set include directories include_directories( include @@ -715,9 +703,6 @@ # notice install(FILES "resources/NOTICE" DESTINATION ${RSTUDIO_INSTALL_SUPPORTING}/resources) - # panmirror scripts - install(DIRECTORY "resources/panmirror-scripts" - DESTINATION ${RSTUDIO_INSTALL_SUPPORTING}/resources) # citation configure_file("resources/CITATION.in" @@ -754,16 +739,6 @@ install(DIRECTORY "${RSTUDIO_DEPENDENCIES_DICTIONARIES_DIR}" DESTINATION "${RSTUDIO_INSTALL_SUPPORTING}/resources") - # install mathjax for local html preview - install(DIRECTORY "${RSTUDIO_DEPENDENCIES_MATHJAX_DIR}" - DESTINATION "${RSTUDIO_INSTALL_SUPPORTING}/resources") - - # install node - install( - DIRECTORY "${RSTUDIO_DEPENDENCIES_DIR}/common/node/${RSTUDIO_INSTALLED_NODE_VERSION}-installed/" - DESTINATION "${RSTUDIO_INSTALL_BIN}/node" - USE_SOURCE_PERMISSIONS) - # install quarto (or pandoc if quarto disabled) if(QUARTO_ENABLED) # install some quarto folders into Resources, as needed @@ -781,9 +756,6 @@ EXCLUDE) endif() else() - install(DIRECTORY "${RSTUDIO_DEPENDENCIES_PANDOC_DIR}/" - DESTINATION "${RSTUDIO_INSTALL_BIN}/pandoc" - USE_SOURCE_PERMISSIONS) endif() # install Copilot Language Server --- a/src/cpp/ext/CMakeLists.txt +++ b/src/cpp/ext/CMakeLists.txt @@ -360,7 +360,7 @@ # a valid library artifact when libgit2's SelectZlib.cmake calls find_package(ZLIB). # If zlib is not yet present, FindZLIB fails and libgit2 falls back to its bundled # deps/zlib, resulting in duplicate zlib symbols in the final binary. -fetch(zlib ZLIB) +fetch(ZLIB ZLIB) # libgit2's src/libgit2/CMakeLists.txt uses FILE(WRITE) to produce git2.h in # the build tree. Unlike configure_file(), FILE(WRITE) unconditionally updates @@ -403,45 +403,6 @@ restore_global_settings() - -# Create dtl target. -add_library(rstudio-dtl INTERFACE EXCLUDE_FROM_ALL) -target_include_directories(rstudio-dtl INTERFACE "${DTL_SOURCE_DIR}") - - -# Create hunspell target. -file(GLOB HUNSPELL_HEADER_FILES "${HUNSPELL_SOURCE_DIR}/src/hunspell/*.h*") -file(GLOB HUNSPELL_SOURCE_FILES "${HUNSPELL_SOURCE_DIR}/src/hunspell/*.c*") -add_library(rstudio-hunspell STATIC ${HUNSPELL_SOURCE_FILES} ${HUNSPELL_HEADER_FILES}) -set_target_properties(rstudio-hunspell PROPERTIES LINKER_LANGUAGE CXX) -target_include_directories(rstudio-hunspell SYSTEM AFTER INTERFACE "${HUNSPELL_SOURCE_DIR}/src") -target_compile_definitions(rstudio-hunspell PUBLIC HUNSPELL_STATIC=1) - -if(WIN32) - target_include_directories(rstudio-hunspell SYSTEM AFTER PRIVATE "${HUNSPELL_PREFIX_DIR}/msvc") - target_compile_options(rstudio-hunspell PRIVATE /wd4244 /wd4267) - target_compile_options(rstudio-hunspell INTERFACE /wd4996) -else() - target_compile_options(rstudio-hunspell PRIVATE -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable) -endif() - - -# Create rapidjson target. -add_library(rstudio-rapidjson INTERFACE EXCLUDE_FROM_ALL) -target_compile_definitions(rstudio-rapidjson INTERFACE "-DRAPIDJSON_NO_SIZETYPEDEFINE") -target_include_directories(rstudio-rapidjson INTERFACE "${RAPIDJSON_SOURCE_DIR}/include") - - -# Create utfcpp target. -add_library(rstudio-utfcpp INTERFACE EXCLUDE_FROM_ALL) -target_include_directories(rstudio-utfcpp INTERFACE "${UTFCPP_SOURCE_DIR}/source") - - -# Create websocketpp target. -add_library(rstudio-websocketpp INTERFACE EXCLUDE_FROM_ALL) -target_include_directories(rstudio-websocketpp INTERFACE "${WEBSOCKETPP_SOURCE_DIR}") - - # Create zlib target (Windows only). # Uses a custom target name to avoid colliding with the 'zlib' OBJECT target # that libgit2 creates from its bundled deps/zlib. --- a/src/cpp/shared_core/CMakeLists.txt +++ b/src/cpp/shared_core/CMakeLists.txt @@ -46,6 +46,9 @@ set (SHARED_INCLUDE_DIRS include ${BOOST_INCLUDEDIR} + ${rapidjson_INCLUDE_DIRS} + ${gsl_lite_INCLUDE_DIRS} + ${dtl_INCLUDE_DIRS} ${EXT_SOURCE_DIR}) # UNIX specific @@ -92,8 +94,8 @@ target_link_libraries(rstudio-shared-core ${Boost_LIBRARIES} ${SHARED_CORE_SYSTEM_LIBS} - gsl::gsl-lite-v1 - rstudio-rapidjson) + ${gsl_lite_LIBRARIES} + ${rapidjson_LIBRARIES}) # Define executable for running unit tests if (RSTUDIO_UNIT_TESTS_ENABLED) --- a/src/cpp/core/CMakeLists.txt +++ b/src/cpp/core/CMakeLists.txt @@ -324,6 +324,11 @@ ${EXT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${TESTS_INCLUDE_DIR} + ${hunspell_INCLUDE_DIRS} + ${tl-expected_INCLUDE_DIRS} + ${gsl_lite_INCLUDE_DIRS} + ${websocketpp_INCLUDE_DIRS} + ${dtl_INCLUDE_DIRS} ) # define shared library @@ -333,10 +338,10 @@ # link dependencies target_link_libraries(rstudio-core rstudio-shared-core - rstudio-dtl - rstudio-hunspell - rstudio-utfcpp - rstudio-websocketpp + ${dtl_LIBRARIES} + ${utfcpp_LIBRARIES} + ${hunspell_LIBRARIES} + ${websocketpp_LIBRARIES} ${Boost_LIBRARIES} ${SOCI_LIBRARIES} ${CORE_SYSTEM_LIBRARIES} --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -381,7 +381,14 @@ find_package(OpenSSL REQUIRED) include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") - + find_package(fmt REQUIRED) + find_package(gsl-lite REQUIRED) + find_package(tl-expected REQUIRED) + find_package(yaml-cpp REQUIRED) + find_package(hunspell REQUIRED) + include_directories(SYSTEM "${hunspell_INCLUDE_DIRS}") + find_package(dtl REQUIRED) + include_directories(SYSTEM "${dtl_INCLUDE_DIRS}") endif() if(WIN32) --- a/src/gwt/build.xml +++ b/src/gwt/build.xml @@ -87,18 +87,9 @@ - - - - - - - - - + @@ -235,7 +226,6 @@ - @@ -253,7 +243,7 @@ - +