diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 77a1a98771..d191f0cce8 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -92,10 +92,15 @@ set( KICOMMON_SRCS jobs/job_sym_export_svg.cpp jobs/job_sym_upgrade.cpp + kicad_curl/kicad_curl.cpp + kicad_curl/kicad_curl_easy.cpp + + advanced_config.cpp asset_archive.cpp array_axis.cpp array_options.cpp bitmap_info.cpp + build_version.cpp config_params.cpp confirm.cpp eda_units.cpp @@ -106,6 +111,7 @@ set( KICOMMON_SRCS locale_io.cpp lset.cpp markup_parser.cpp + paths.cpp richio.cpp string_utils.cpp trace_helpers.cpp @@ -122,6 +128,7 @@ target_link_libraries( kicommon kiplatform nlohmann_json fmt::fmt + CURL::libcurl ${wxWidgets_LIBRARIES} # needed by kiid to allow linking for Boost for the UUID against bcrypt (msys2 only) @@ -407,7 +414,6 @@ set( COMMON_SRCS ${FONT_SRCS} ${COMMON_IMPORT_GFX_SRCS} jobs/job_dispatcher.cpp - advanced_config.cpp background_jobs_monitor.cpp base_screen.cpp bin_mod.cpp @@ -415,7 +421,6 @@ set( COMMON_SRCS bitmap_base.cpp bitmap_store.cpp board_printout.cpp - build_version.cpp cli_progress_reporter.cpp commit.cpp common.cpp @@ -465,7 +470,6 @@ set( COMMON_SRCS notifications_manager.cpp origin_transforms.cpp page_info.cpp - paths.cpp plugin_file_desc.cpp printout.cpp project.cpp @@ -502,11 +506,6 @@ if( TRUE OR NOT USE_KIWAY_DLLS ) endif() endif() -list( APPEND COMMON_SRCS - kicad_curl/kicad_curl.cpp - kicad_curl/kicad_curl_easy.cpp -) - set( COMMON_SRCS ${COMMON_SRCS} @@ -605,7 +604,6 @@ target_link_libraries( common # Database support needs these two nanodbc # for now; maybe hoist out of common Boost::locale - CURL::libcurl ${wxWidgets_LIBRARIES} ${EXTRA_LIBS} # outline font support diff --git a/common/build_version.cpp b/common/build_version.cpp index af691143ce..a57f4bca87 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -28,6 +28,7 @@ #include <boost/version.hpp> #include <kiplatform/app.h> #include <font/version_info.h> +#include <build_version.h> #include <tuple> diff --git a/common/kicad_curl/kicad_curl_easy.cpp b/common/kicad_curl/kicad_curl_easy.cpp index 6107f59c47..0261a46057 100644 --- a/common/kicad_curl/kicad_curl_easy.cpp +++ b/common/kicad_curl/kicad_curl_easy.cpp @@ -39,7 +39,6 @@ #include <ki_exception.h> // THROW_IO_ERROR #include <kiplatform/app.h> #include <kiplatform/environment.h> -#include <pgm_base.h> #include <kiplatform/policy.h> #include <policy_keys.h> @@ -156,7 +155,7 @@ KICAD_CURL_EASY::KICAD_CURL_EASY() : } wxPlatformInfo platformInfo; - wxString application( Pgm().App().GetAppName() ); + wxString application( wxS( "KiCad" ) ); wxString version( GetBuildVersion() ); wxString platform = wxS( "(" ) + wxGetOsDescription() + wxS( ";" ) + GetPlatformGetBitnessName(); diff --git a/include/advanced_config.h b/include/advanced_config.h index 9ebab902a1..c494b71fbe 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -24,6 +24,8 @@ #ifndef ADVANCED_CFG__H #define ADVANCED_CFG__H +#include <kicommon.h> + class wxConfigBase; /** @@ -58,7 +60,7 @@ class wxConfigBase; * */ -class ADVANCED_CFG +class KICOMMON_API ADVANCED_CFG { public: /** diff --git a/include/build_version.h b/include/build_version.h index c0b5d419d5..694e364770 100644 --- a/include/build_version.h +++ b/include/build_version.h @@ -27,6 +27,7 @@ #ifndef KICAD_BUILD_VERSION_H #define KICAD_BUILD_VERSION_H +#include <kicommon.h> #include <tuple> class wxString; @@ -37,12 +38,12 @@ class wxString; * * @return the full version string */ -wxString GetBuildVersion(); +KICOMMON_API wxString GetBuildVersion(); /** * @return the bitness name string (like "Little endian") */ -wxString GetPlatformGetBitnessName(); +KICOMMON_API wxString GetPlatformGetBitnessName(); /** * Get the semantic version string for KiCad defined inside the KiCadVersion.cmake file in @@ -50,7 +51,7 @@ wxString GetPlatformGetBitnessName(); * * @return the semantic version string */ -wxString GetSemanticVersion(); +KICOMMON_API wxString GetSemanticVersion(); /** * Get only the major and minor version in a string major.minor. @@ -58,7 +59,7 @@ wxString GetSemanticVersion(); * * @return the major and minor version as a string */ -wxString GetMajorMinorVersion(); +KICOMMON_API wxString GetMajorMinorVersion(); /** * Get the major, minor and patch version in a string major.minor.patch @@ -66,34 +67,34 @@ wxString GetMajorMinorVersion(); * * @return the major.minor.patch version as a string */ -wxString GetMajorMinorPatchVersion(); +KICOMMON_API wxString GetMajorMinorPatchVersion(); /** * Get the build date as a string. * * @return the build date string */ -wxString GetBuildDate(); +KICOMMON_API wxString GetBuildDate(); /** * Get the commit hash as a string. * * @return the commit hash string */ -wxString GetCommitHash(); +KICOMMON_API wxString GetCommitHash(); /** * Get the build version numbers as a tuple * * @return A tuple with three ints for major/minor/patch revisions */ -const std::tuple<int,int,int>& GetMajorMinorPatchTuple(); +KICOMMON_API const std::tuple<int, int, int>& GetMajorMinorPatchTuple(); /** * Check if the build is meant to be nightly * @return true if running nightly build */ -bool IsNightlyVersion(); +KICOMMON_API bool IsNightlyVersion(); /** * Create a version info string for bug reports and the about dialog @@ -102,6 +103,7 @@ bool IsNightlyVersion(); * @param aHtml = true to use a minimal HTML format, false for plan text * @return the version info string */ -wxString GetVersionInfoData( const wxString& aTitle, bool aHtml = false, bool aBrief = false ); +KICOMMON_API wxString GetVersionInfoData( const wxString& aTitle, bool aHtml = false, + bool aBrief = false ); #endif // KICAD_BUILD_VERSION_H diff --git a/include/kicad_curl/kicad_curl.h b/include/kicad_curl/kicad_curl.h index 3350a39720..49e32a2761 100644 --- a/include/kicad_curl/kicad_curl.h +++ b/include/kicad_curl/kicad_curl.h @@ -41,6 +41,7 @@ #endif #endif +#include <kicommon.h> #include <curl/curl.h> #include <string> @@ -56,7 +57,7 @@ /** * Simple wrapper class to call curl_global_init and curl_global_cleanup for KiCad. */ -class KICAD_CURL +class KICOMMON_API KICAD_CURL { public: /** diff --git a/include/kicad_curl/kicad_curl_easy.h b/include/kicad_curl/kicad_curl_easy.h index 4f46d0f7ed..1548ad3681 100644 --- a/include/kicad_curl/kicad_curl_easy.h +++ b/include/kicad_curl/kicad_curl_easy.h @@ -33,6 +33,7 @@ * and including kicad_curl.h could be needed in a few sources */ +#include <kicommon.h> #include <functional> #include <memory> #include <ostream> @@ -63,7 +64,7 @@ typedef std::function<int( size_t, size_t, size_t, size_t )> TRANSFER_CALLBACK; struct CURL_PROGRESS; -class KICAD_CURL_EASY +class KICOMMON_API KICAD_CURL_EASY { public: KICAD_CURL_EASY(); diff --git a/include/paths.h b/include/paths.h index 51eea53dd9..e53c61f9aa 100644 --- a/include/paths.h +++ b/include/paths.h @@ -20,6 +20,7 @@ #ifndef PATHS_H #define PATHS_H +#include <kicommon.h> #include <wx/filename.h> #include <wx/string.h> @@ -32,7 +33,7 @@ /** * Helper class to centralize the paths used throughout kicad */ -class PATHS +class KICOMMON_API PATHS { public: