summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-18 16:50:03 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:08 -0300
commit6e5ab7a42253697511a5153a80b66760a04e5f45 (patch)
tree3414cb7d71b7bb357b7143bb7857b8cfb299e166
parent199eb768315920a3479251e2e247a5257a6a6dfd (diff)
Use CMake DEFINES to export symbols.
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--CMakeLists.txt4
-rw-r--r--apiextractormacros.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 65799be8..ebc054ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ if (NOT DISABLE_DOCSTRINGS)
endif()
if(MSVC)
- set(CMAKE_CXX_FLAGS "-/Zc:wchar_t- /GR /EHsc /DNOCOLOR /DWIN32 /D_WINDOWS /DAPIEXTRACTOR_BUILD /D_SCL_SECURE_NO_WARNINGS")
+ set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DNOCOLOR /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS")
elseif(CMAKE_HOST_UNIX)
option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimize library size and performance. Only available on Release Mode" 0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden")
@@ -120,7 +120,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
add_library(apiextractor SHARED ${apiextractor_SRC} ${apiextractor_RCCS_SRC})
target_link_libraries(apiextractor ${APIEXTRACTOR_EXTRA_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTXMLPATTERNS_LIBRARY} ${QT_QTXML_LIBRARY})
-set_target_properties(apiextractor PROPERTIES VERSION ${apiextractor_VERSION} SOVERSION ${apiextractor_SOVERSION})
+set_target_properties(apiextractor PROPERTIES VERSION ${apiextractor_VERSION} SOVERSION ${apiextractor_SOVERSION} DEFINE_SYMBOL APIEXTRACTOR_EXPORTS)
# create pkg-config file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/apiextractor.pc.in"
diff --git a/apiextractormacros.h b/apiextractormacros.h
index d56741db..27a8778e 100644
--- a/apiextractormacros.h
+++ b/apiextractormacros.h
@@ -4,10 +4,10 @@
// APIEXTRACTOR_API is used for the public API symbols.
#if defined _WIN32 || defined __CYGWIN__
- #if APIEXTRACTOR_BUILD
+ #if APIEXTRACTOR_EXPORTS
#define APIEXTRACTOR_API __declspec(dllexport)
#else
- #define APIEXTRACTOR_API __declspec(dllimport)
+ #define APIEXTRACTOR_API
#endif
#else
#if __GNUC__ >= 4