Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
7e94e6b5
Commit
7e94e6b5
authored
Mar 21, 2012
by
David Cole
Committed by
Kitware Robot
Mar 21, 2012
Browse files
Merge topic 'watcom-object-library'
fb7348f6
Fix ObjectLibrary test on Watcom
parents
a72893da
fb7348f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Tests/ObjectLibrary/A/CMakeLists.txt
View file @
7e94e6b5
# Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this.
if
(
CMAKE_SHARED_LIBRARY_C_FLAGS
)
if
(
CMAKE_SHARED_LIBRARY_C_FLAGS
AND NOT WATCOM
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_SHARED_LIBRARY_C_FLAGS
}
${
CMAKE_C_FLAGS
}
"
)
endif
()
add_definitions
(
-DA
)
add_definitions
(
-DA
_DEF
)
add_custom_command
(
OUTPUT a1.c
...
...
Tests/ObjectLibrary/A/a.h
View file @
7e94e6b5
#ifndef A
# error "A not defined"
#ifndef A
_DEF
# error "A
_DEF
not defined"
#endif
#ifdef B
# error "B must not be defined"
#ifdef B
_DEF
# error "B
_DEF
must not be defined"
#endif
Tests/ObjectLibrary/B/CMakeLists.txt
View file @
7e94e6b5
...
...
@@ -5,11 +5,11 @@ endif()
# Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this.
if
(
CMAKE_SHARED_LIBRARY_C_FLAGS
)
if
(
CMAKE_SHARED_LIBRARY_C_FLAGS
AND NOT WATCOM
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_SHARED_LIBRARY_C_FLAGS
}
${
CMAKE_C_FLAGS
}
"
)
endif
()
add_definitions
(
-DB
)
add_definitions
(
-DB
_DEF
)
add_library
(
B OBJECT b1.c b2.c
)
add_library
(
Bexport OBJECT b1
${
vs6
}
.c b2
${
vs6
}
.c
)
set_property
(
TARGET Bexport PROPERTY COMPILE_DEFINITIONS Bexport
)
Tests/ObjectLibrary/B/b.h
View file @
7e94e6b5
#ifdef A
# error "A must not be defined"
#ifdef A
_DEF
# error "A
_DEF
must not be defined"
#endif
#ifndef B
# error "B not defined"
#ifndef B
_DEF
# error "B
_DEF
not defined"
#endif
#if defined(_WIN32) && defined(Bexport)
# define EXPORT_B __declspec(dllexport)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment