[CMake] SS12 and -xcode=pic32

George Neill georgen at neillnet.com
Mon Oct 27 16:27:05 EDT 2008


Alan,

On Mon, Oct 27, 2008 at 3:10 PM, Alan W. Irwin
<irwin at beluga.phys.uvic.ca> wrote:
> On 2008-10-27 12:54-0500 George Neill wrote:
>
>> Hi All,
>>
>> I am using cmake 2.4.8 and Sun Studio 12.
>>
>> I am trying to overwrite these default cmake compiler settings from
>> Modules/Platorm/SunOS.cmake
>>
>>  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
>>  SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
>>
>> to
>>
>>  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-xcode=pic32")
>>  SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-xcode=pic32")
>>
>> However I am not having any luck.
>>
> {...]
>>
>> Any suggestions?
>
> The brute-force but completely reliable method is to
> set your desired compilers and associated flags before running cmake, e.g.,
>
> export CC='cc -xcode=pic32'
> export CXX='c++ -xcode=pic32'

Should that be ...

export CFLAGS="-xcode=pic32"
export CXXFLAGS="-xcode=pic32"

... neither of those methods will remove/replace the -KPIC flag from
the compile line.  But yeah, that brings up another issue; I don't
want to unnecessarily compile all of my code with -xcode=pic32 when it
doesn't need to.

TIA,
George.


More information about the CMake mailing list