From 6d434ee6ccc250bfc653281643d70a3d1f8938cc Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Sep 2009 09:37:35 -0400 Subject: [PATCH] Split XL compiler information files This moves platform-independent XL compiler flags into separate "Compiler/XL-.cmake" modules. Platform-specific flags go in "Platform/-XL-.cmake" modules. --- Modules/Compiler/XL-C.cmake | 8 +++++ Modules/Compiler/XL-CXX.cmake | 11 +++++++ Modules/Compiler/XL-Fortran.cmake | 5 +++ Modules/Platform/AIX-VisualAge-C.cmake | 1 + Modules/Platform/AIX-VisualAge-CXX.cmake | 1 + Modules/Platform/AIX-XL-C.cmake | 4 +++ Modules/Platform/AIX-XL-CXX.cmake | 4 +++ Modules/Platform/AIX-XL-Fortran.cmake | 4 +++ Modules/Platform/AIX.cmake | 31 ------------------- Modules/Platform/Darwin-VisualAge-C.cmake | 1 + Modules/Platform/Darwin-VisualAge-CXX.cmake | 1 + .../{Darwin-xlc.cmake => Darwin-XL-C.cmake} | 1 - Modules/Platform/Darwin-XL-CXX.cmake | 5 +++ 13 files changed, 45 insertions(+), 32 deletions(-) create mode 100644 Modules/Platform/AIX-VisualAge-C.cmake create mode 100644 Modules/Platform/AIX-VisualAge-CXX.cmake create mode 100644 Modules/Platform/AIX-XL-C.cmake create mode 100644 Modules/Platform/AIX-XL-CXX.cmake create mode 100644 Modules/Platform/AIX-XL-Fortran.cmake create mode 100644 Modules/Platform/Darwin-VisualAge-C.cmake create mode 100644 Modules/Platform/Darwin-VisualAge-CXX.cmake rename Modules/Platform/{Darwin-xlc.cmake => Darwin-XL-C.cmake} (76%) create mode 100644 Modules/Platform/Darwin-XL-CXX.cmake diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake index 3120478e6..cc4c7eb13 100644 --- a/Modules/Compiler/XL-C.cmake +++ b/Modules/Compiler/XL-C.cmake @@ -1 +1,9 @@ SET(CMAKE_C_VERBOSE_FLAG "-V") + +SET(CMAKE_C_FLAGS_DEBUG_INIT "-g") +SET(CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG") +SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG") +SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g") + +SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") +SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake index 618ff5ade..961cfee61 100644 --- a/Modules/Compiler/XL-CXX.cmake +++ b/Modules/Compiler/XL-CXX.cmake @@ -1 +1,12 @@ SET(CMAKE_CXX_VERBOSE_FLAG "-V") + +SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g") +SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O -DNDEBUG") +SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG") +SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g") + +SET(CMAKE_CXX_COMPILE_OBJECT + " -+ -o -c ") + +SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") +SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake index 49d6bb2f3..6133f5638 100644 --- a/Modules/Compiler/XL-Fortran.cmake +++ b/Modules/Compiler/XL-Fortran.cmake @@ -1,2 +1,7 @@ SET(CMAKE_Fortran_VERBOSE_FLAG "-V") SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D") + +SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g") +SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O") +SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-O") +SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g") diff --git a/Modules/Platform/AIX-VisualAge-C.cmake b/Modules/Platform/AIX-VisualAge-C.cmake new file mode 100644 index 000000000..67b3171dc --- /dev/null +++ b/Modules/Platform/AIX-VisualAge-C.cmake @@ -0,0 +1 @@ +include(Platform/AIX-XL-C) diff --git a/Modules/Platform/AIX-VisualAge-CXX.cmake b/Modules/Platform/AIX-VisualAge-CXX.cmake new file mode 100644 index 000000000..7894d244f --- /dev/null +++ b/Modules/Platform/AIX-VisualAge-CXX.cmake @@ -0,0 +1 @@ +include(Platform/AIX-XL-CXX) diff --git a/Modules/Platform/AIX-XL-C.cmake b/Modules/Platform/AIX-XL-C.cmake new file mode 100644 index 000000000..2de30d5b7 --- /dev/null +++ b/Modules/Platform/AIX-XL-C.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib +SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ") +SET(CMAKE_SHARED_MODULE_C_FLAGS " ") diff --git a/Modules/Platform/AIX-XL-CXX.cmake b/Modules/Platform/AIX-XL-CXX.cmake new file mode 100644 index 000000000..648cb311b --- /dev/null +++ b/Modules/Platform/AIX-XL-CXX.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared +SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib +SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ") +SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ") diff --git a/Modules/Platform/AIX-XL-Fortran.cmake b/Modules/Platform/AIX-XL-Fortran.cmake new file mode 100644 index 000000000..8292e785d --- /dev/null +++ b/Modules/Platform/AIX-XL-Fortran.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared +SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib +SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS " ") +SET(CMAKE_SHARED_MODULE_Fortran_FLAGS " ") diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 455586d4f..c8a33c32f 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -18,44 +18,13 @@ SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1) # CXX Compiler IF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-G") # -shared -ELSE(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib - SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ") - SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ") - SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") - SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O -DNDEBUG") - SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG") - SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g") ENDIF(CMAKE_COMPILER_IS_GNUCXX) # C Compiler IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared -ELSE(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib - SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ") - SET(CMAKE_SHARED_MODULE_C_FLAGS " ") - SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") - SET (CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG") - SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG") - SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g") ENDIF(CMAKE_COMPILER_IS_GNUCC) -IF(NOT CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") - SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") -ENDIF(NOT CMAKE_COMPILER_IS_GNUCC) - -IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_COMPILE_OBJECT - " -+ -o -c ") - SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") - SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") -ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) - - # since .a can be a static or shared library on AIX, we can not do this. # at some point if we wanted it, we would have to figure out if a .a is # static or shared, then we could add this back: diff --git a/Modules/Platform/Darwin-VisualAge-C.cmake b/Modules/Platform/Darwin-VisualAge-C.cmake new file mode 100644 index 000000000..859914f86 --- /dev/null +++ b/Modules/Platform/Darwin-VisualAge-C.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-XL-C) diff --git a/Modules/Platform/Darwin-VisualAge-CXX.cmake b/Modules/Platform/Darwin-VisualAge-CXX.cmake new file mode 100644 index 000000000..46c1005df --- /dev/null +++ b/Modules/Platform/Darwin-VisualAge-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-XL-CXX) diff --git a/Modules/Platform/Darwin-xlc.cmake b/Modules/Platform/Darwin-XL-C.cmake similarity index 76% rename from Modules/Platform/Darwin-xlc.cmake rename to Modules/Platform/Darwin-XL-C.cmake index f7e4da339..934ebcc8c 100644 --- a/Modules/Platform/Darwin-xlc.cmake +++ b/Modules/Platform/Darwin-XL-C.cmake @@ -3,4 +3,3 @@ SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle") # Enable shared library versioning. SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-install_name") -SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-install_name") diff --git a/Modules/Platform/Darwin-XL-CXX.cmake b/Modules/Platform/Darwin-XL-CXX.cmake new file mode 100644 index 000000000..22ae0183a --- /dev/null +++ b/Modules/Platform/Darwin-XL-CXX.cmake @@ -0,0 +1,5 @@ +SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj") +SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle") + +# Enable shared library versioning. +SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-install_name")