Hi All;

No matter Linux or Windows, when try to build SHARED library, it will always 
get the following error message. 
ADD_LIBRARY(hello SHARED  hello.c)

ADD_LIBRARY for library hello is used with the SHARED option, but the target 
platform supports only STATIC libraries. Building it STATIC instead. This may 
lead to problems.

My question:
a) Why not support it? Is my CMakeLists any wrong for cross compiling?
b) Is there any method available to support it?

I have searched in google and found the following threat, but after 
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE), it still got 
the same error message.
http://web.archiveorange.com/archive/v/5y7PkYdzD3pM4MX0QSD9

Anyone who has idea about it please help, thanks. 

>>>>>>>>>>>>>>>>  brewmp-arm.cmake
INCLUDE (CMakeForceCompiler)

SET (CMAKE_SYSTEM_NAME Generic)
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)
SET (CMAKE_CROSSCOMPILING 1)

SET (RVCT40BIN $ENV{RVCT40BIN})
SET (BREWMP_PLATFORM $ENV{BREWMPSDK})

SET (_CMAKE_TOOLCHAIN_PREFIX arm)
SET (_CMAKE_TOOLCHAIN_LOCATION ${RVCT40BIN})

find_file(ARMCC armcc ${RVCT40BIN})
CMAKE_FORCE_C_COMPILER (${ARMCC} ArmBMPCross)
CMAKE_FORCE_CXX_COMPILER (${ARMCC} ArmBMPCross)
                   
set (CMAKE_C_FLAGS "--cpu ARM9TDMI --apcs /noropi/interwork/norwpi --littleend 
--split_sections --fpu=softvfp --exceptions --no_implicit_include 
${BREWMP_INCLUDE} ${BREWMP_DEFINE}" CACHE STRING "c flags" FORCE)
set (CMAKE_CXX_FLAGS "--cpu ARM9TDMI --apcs /noropi/interwork/norwpi 
--littleend --split_sections --fpu=softvfp --exceptions --no_implicit_include 
${BREWMP_INCLUDE} ${BREWMP_DEFINE}" CACHE STRING "c++ flags" FORCE)

SET (CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <LINK_FLAGS> 
<TARGET> <OBJECTS>")
SET (CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <LINK_FLAGS> 
<TARGET> <OBJECTS>")


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to