From 285f8c0b880b477b65281c249ba3018981c4f474 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Thu, 14 Sep 2023 19:21:43 -0400 Subject: [PATCH] KIID kicommon --- cmake/Warnings.cmake | 2 ++ common/CMakeLists.txt | 3 ++- include/kiid.h | 15 ++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/Warnings.cmake b/cmake/Warnings.cmake index 4566438395..a56a1bec71 100644 --- a/cmake/Warnings.cmake +++ b/cmake/Warnings.cmake @@ -205,6 +205,8 @@ if( MSVC ) # set( WARN_FLAGS_C "/external:W0 /external:env:INCLUDE /external:I${CMAKE_SOURCE_DIR}/thirdparty /Wall" ) set( WARN_FLAGS_CXX "/external:W0 /external:env:INCLUDE /external:I${CMAKE_SOURCE_DIR}/thirdparty /Wall" ) + # disable 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2' + string( APPEND WARN_FLAGS_CXX " /wd4251" ) # disable "function not inlined" string( APPEND WARN_FLAGS_CXX " /wd4710" ) # disable "function selected for inline expansion" diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 49d6f727f5..ce7897a129 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -48,6 +48,7 @@ set( KICOMMON_SRCS array_options.cpp bitmap_info.cpp exceptions.cpp + kiid.cpp lib_id.cpp locale_io.cpp markup_parser.cpp @@ -64,6 +65,7 @@ target_link_libraries( kicommon core kimath kiplatform + nlohmann_json fmt::fmt ${wxWidgets_LIBRARIES} ) @@ -403,7 +405,6 @@ set( COMMON_SRCS hotkey_store.cpp hotkeys_basic.cpp kiface_base.cpp - kiid.cpp kiway.cpp kiway_express.cpp kiway_holder.cpp diff --git a/include/kiid.h b/include/kiid.h index 1dcfe4cb92..bb0c874ce7 100644 --- a/include/kiid.h +++ b/include/kiid.h @@ -26,6 +26,7 @@ #ifndef KIID_H #define KIID_H +#include #include #include #include @@ -44,7 +45,7 @@ class wxString; */ typedef uint32_t timestamp_t; -class KIID +class KICOMMON_API KIID { public: KIID(); @@ -129,14 +130,14 @@ private: }; -extern KIID niluuid; +extern KICOMMON_API KIID niluuid; -KIID& NilUuid(); +KICOMMON_API KIID& NilUuid(); // declare KIID_VECT_LIST as std::vector both for c++ and swig: DECL_VEC_FOR_SWIG( KIID_VECT_LIST, KIID ) -class KIID_PATH : public KIID_VECT_LIST +class KICOMMON_API KIID_PATH : public KIID_VECT_LIST { public: KIID_PATH() @@ -195,7 +196,7 @@ public: /** * RAII class to safely set/reset nil KIIDs for use in footprint/symbol loading */ -class KIID_NIL_SET_RESET +class KICOMMON_API KIID_NIL_SET_RESET { public: KIID_NIL_SET_RESET() @@ -209,8 +210,8 @@ public: } }; -void to_json( nlohmann::json& aJson, const KIID& aKIID ); +KICOMMON_API void to_json( nlohmann::json& aJson, const KIID& aKIID ); -void from_json( const nlohmann::json& aJson, KIID& aKIID ); +KICOMMON_API void from_json( const nlohmann::json& aJson, KIID& aKIID ); #endif // KIID_H