mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Handle the case where the user changes the DEFINE_SYMBOL property.
This eases porting of KDE code.
This commit is contained in:
@@ -107,6 +107,8 @@ macro_add_test_library(libstatic)
|
||||
add_subdirectory(lib_shared_and_static)
|
||||
add_subdirectory(lib_shared_and_statictest)
|
||||
|
||||
add_subdirectory(override_symbol)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
# We deliberately call deprecated methods, and test for that elsewhere.
|
||||
# No need to clutter the test output with warnings.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
project(override_symbol)
|
||||
|
||||
add_library(somelib SHARED someclass.cpp)
|
||||
|
||||
set_target_properties(somelib PROPERTIES DEFINE_SYMBOL SOMELIB_MAKEDLL)
|
||||
|
||||
generate_export_header(somelib)
|
||||
|
||||
add_executable(consumer main.cpp)
|
||||
|
||||
target_link_libraries(consumer somelib)
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
#include "someclass.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
SomeClass sc;
|
||||
sc.someMethod();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
#include "someclass.h"
|
||||
|
||||
void SomeClass::someMethod() const
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
#include "somelib_export.h"
|
||||
|
||||
class SOMELIB_EXPORT SomeClass
|
||||
{
|
||||
public:
|
||||
void someMethod() const;
|
||||
};
|
||||
Reference in New Issue
Block a user