Merge topic 'windows-rc-enable-later'

772eae44 RC: Add platform-specific preprocessor definitions (#15404)
4300de3e RC: Enable language after C, CXX, or Fortran is enabled (#15404)
1de4a0fb RC: Drop unused CMAKE_COMPILE_RESOURCE variable setting
This commit is contained in:
Brad King 2015-02-26 08:52:09 -05:00 committed by CMake Topic Stage
commit 4817d2814a
4 changed files with 10 additions and 9 deletions

View File

@ -25,7 +25,6 @@ set(CMAKE_CREATE_WIN32_EXE "-mwindows")
set(CMAKE_GNULD_IMAGE_VERSION set(CMAKE_GNULD_IMAGE_VERSION
"-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>") "-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
set(CMAKE_GENERATOR_RC windres) set(CMAKE_GENERATOR_RC windres)
enable_language(RC)
macro(__cygwin_compiler_gnu lang) macro(__cygwin_compiler_gnu lang)
# Binary link rules. # Binary link rules.
set(CMAKE_${lang}_CREATE_SHARED_MODULE set(CMAKE_${lang}_CREATE_SHARED_MODULE
@ -53,4 +52,6 @@ macro(__cygwin_compiler_gnu lang)
# TODO: Is -Wl,--enable-auto-import now always default? # TODO: Is -Wl,--enable-auto-import now always default?
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--enable-auto-import") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--enable-auto-import")
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}") set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}")
enable_language(RC)
endmacro() endmacro()

View File

@ -61,8 +61,6 @@ if(NOT CMAKE_GENERATOR_RC AND CMAKE_GENERATOR MATCHES "Unix Makefiles")
set(CMAKE_GENERATOR_RC windres) set(CMAKE_GENERATOR_RC windres)
endif() endif()
enable_language(RC)
macro(__windows_compiler_gnu lang) macro(__windows_compiler_gnu lang)
if(MSYS OR MINGW) if(MSYS OR MINGW)
@ -139,6 +137,8 @@ macro(__windows_compiler_gnu lang)
) )
endforeach() endforeach()
endif() endif()
enable_language(RC)
endmacro() endmacro()
macro(__windows_compiler_gnu_abi lang) macro(__windows_compiler_gnu_abi lang)

View File

@ -53,10 +53,6 @@ if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
set (CMAKE_NO_BUILD_TYPE 1) set (CMAKE_NO_BUILD_TYPE 1)
endif() endif()
# make sure to enable languages after setting configuration types
enable_language(RC)
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(MSVC_IDE 1) set(MSVC_IDE 1)
else() else()
@ -301,4 +297,10 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON) set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON)
if(NOT CMAKE_RC_FLAGS_INIT)
set(CMAKE_RC_FLAGS_INIT "${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_${lang}}")
endif()
enable_language(RC)
endmacro() endmacro()

View File

@ -24,8 +24,6 @@ set(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /o
set(CMAKE_Fortran_COMPILE_OBJECT set(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /object:<OBJECT> <FLAGS> /compile_only <SOURCE>${CMAKE_END_TEMP_FILE}") "<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /object:<OBJECT> <FLAGS> /compile_only <SOURCE>${CMAKE_END_TEMP_FILE}")
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
set(CMAKE_Fortran_LINK_EXECUTABLE set(CMAKE_Fortran_LINK_EXECUTABLE
"<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")