move ansi cxx flags stuff out of try compile and into cmake files

This commit is contained in:
Bill Hoffman 2002-11-21 14:11:53 -05:00
parent 02ef2fb568
commit a7098d1433
5 changed files with 6 additions and 16 deletions

View File

@ -13,6 +13,7 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
TRY_COMPILE(${VARIABLE} TRY_COMPILE(${VARIABLE}
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx ${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS}
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE}) IF(${VARIABLE})
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")

View File

@ -7,7 +7,8 @@
IF(NOT CMAKE_ANSI_FOR_SCOPE) IF(NOT CMAKE_ANSI_FOR_SCOPE)
MESSAGE(STATUS "Check for ANSI scope") MESSAGE(STATUS "Check for ANSI scope")
TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${PROJECT_BINARY_DIR} TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${PROJECT_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx) ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS})
IF (CMAKE_ANSI_FOR_SCOPE) IF (CMAKE_ANSI_FOR_SCOPE)
MESSAGE(STATUS "Check for ANSI scope - found") MESSAGE(STATUS "Check for ANSI scope - found")
SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL

View File

@ -7,7 +7,8 @@
IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS) IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
MESSAGE(STATUS "Check for ANSI stream headers") MESSAGE(STATUS "Check for ANSI stream headers")
TRY_COMPILE(CMAKE_ANSI_STREAM_HEADERS ${PROJECT_BINARY_DIR} TRY_COMPILE(CMAKE_ANSI_STREAM_HEADERS ${PROJECT_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cxx) ${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cxx
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS})
IF (CMAKE_ANSI_STREAM_HEADERS) IF (CMAKE_ANSI_STREAM_HEADERS)
MESSAGE(STATUS "Check for ANSI stream headers - found") MESSAGE(STATUS "Check for ANSI stream headers - found")
SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL

View File

@ -7,6 +7,7 @@
IF(NOT CMAKE_STD_NAMESPACE) IF(NOT CMAKE_STD_NAMESPACE)
MESSAGE(STATUS "Check for STD namespace") MESSAGE(STATUS "Check for STD namespace")
TRY_COMPILE(CMAKE_STD_NAMESPACE ${PROJECT_BINARY_DIR} TRY_COMPILE(CMAKE_STD_NAMESPACE ${PROJECT_BINARY_DIR}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS}
${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx) ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx)
IF (CMAKE_STD_NAMESPACE) IF (CMAKE_STD_NAMESPACE)
MESSAGE(STATUS "Check for STD namespace - found") MESSAGE(STATUS "Check for STD namespace - found")

View File

@ -153,20 +153,6 @@ int cmTryCompileCommand::CoreTryCompileCode(
return -1; return -1;
} }
if ( format == cmSystemTools::CXX_FILE_FORMAT )
{
fprintf(fout, "IF (CMAKE_ANSI_CXXFLAGS)\n");
fprintf(fout, " SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS}"
" ${CMAKE_ANSI_CXXFLAGS}\")\n");
fprintf(fout, "ENDIF (CMAKE_ANSI_CXXFLAGS)\n");
}
if ( format == cmSystemTools::C_FILE_FORMAT )
{
fprintf(fout, "IF (CMAKE_ANSI_CFLAGS)\n");
fprintf(fout, " SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}\")\n");
fprintf(fout, "ENDIF (CMAKE_ANSI_CFLAGS)\n");
}
fprintf(fout, "ADD_DEFINITIONS(${COMPILE_DEFINITIONS})\n"); fprintf(fout, "ADD_DEFINITIONS(${COMPILE_DEFINITIONS})\n");
fprintf(fout, "INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n"); fprintf(fout, "INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n");
fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n"); fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n");