Removed Objective-C compiler modules
This commit is contained in:
parent
f913940427
commit
ac2f5e1bce
7 changed files with 5 additions and 325 deletions
|
@ -1,19 +0,0 @@
|
|||
# Copyright (C) 2015 Franklin "Snaipe" Mathieu.
|
||||
# Redistribution and use of this file is allowed according to the terms of the MIT license.
|
||||
# For details see the LICENSE file distributed with Criterion.
|
||||
|
||||
# CMake <2.8.10 backward compat
|
||||
if(NOT CMAKE_PLATFORM_INFO_DIR)
|
||||
set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
||||
endif(NOT CMAKE_PLATFORM_INFO_DIR)
|
||||
|
||||
set(CMAKE_ObjectiveC_COMPILER_ID ${CMAKE_C_COMPILER_ID})
|
||||
set(CMAKE_ObjectiveC_COMPILER ${CMAKE_C_COMPILER})
|
||||
|
||||
# configure variables set in this file for fast reload later on
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeObjectiveCCompiler.cmake.in
|
||||
${CMAKE_PLATFORM_INFO_DIR}/CMakeObjectiveCCompiler.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
set(CMAKE_ObjectiveC_COMPILER_ENV_VAR "OBJCC")
|
|
@ -1,10 +0,0 @@
|
|||
set(CMAKE_ObjectiveC_COMPILER "@CMAKE_ObjectiveC_COMPILER@")
|
||||
set(CMAKE_ObjectiveC_COMPILER_ID "@CMAKE_ObjectiveC_COMPILER_ID@")
|
||||
|
||||
set(CMAKE_ObjectiveC_IMPLICIT_LINK_LIBRARIES "@CMAKE_ObjectiveC_IMPLICIT_LINK_LIBRARIES@")
|
||||
|
||||
set(CMAKE_ObjectiveC_COMPILER_LOADED 1)
|
||||
set(CMAKE_ObjectiveC_COMPILER_WORKS @CMAKE_ObjectiveC_COMPILER_WORKS@)
|
||||
|
||||
set(CMAKE_ObjectiveC_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_ObjectiveC_SOURCE_FILE_EXTENSIONS m)
|
|
@ -1,192 +0,0 @@
|
|||
if(UNIX)
|
||||
set(CMAKE_ObjectiveC_OUTPUT_EXTENSION .o)
|
||||
else()
|
||||
set(CMAKE_ObjectiveC_OUTPUT_EXTENSION .obj)
|
||||
endif()
|
||||
|
||||
set(_INCLUDED_FILE 0)
|
||||
set(_INCLUDED_FILE_2 0)
|
||||
|
||||
# Load compiler-specific information.
|
||||
if(CMAKE_ObjectiveC_COMPILER_ID)
|
||||
include(Compiler/${CMAKE_ObjectiveC_COMPILER_ID}-C OPTIONAL)
|
||||
endif()
|
||||
|
||||
set(CMAKE_BASE_NAME)
|
||||
get_filename_component(CMAKE_BASE_NAME "${CMAKE_ObjectiveC_COMPILER}" NAME_WE)
|
||||
|
||||
# load a hardware specific file, mostly useful for embedded compilers
|
||||
if(CMAKE_SYSTEM_PROCESSOR)
|
||||
if(CMAKE_ObjectiveC_COMPILER_ID)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ObjectiveC_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ObjectiveC_COMPILER_ID}-ObjectiveC-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE_2)
|
||||
endif()
|
||||
if (NOT _INCLUDED_FILE AND NOT _INCLUDED_FILE_2)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
# load the system- and compiler specific files
|
||||
if(CMAKE_ObjectiveC_COMPILER_ID)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ObjectiveC_COMPILER_ID}-C
|
||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ObjectiveC_COMPILER_ID}-ObjectiveC
|
||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE_2)
|
||||
endif()
|
||||
if (NOT _INCLUDED_FILE AND _INCLUDED_FILE_2)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
|
||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
endif ()
|
||||
|
||||
# We specify the compiler information in the system file for some
|
||||
# platforms, but this language may not have been enabled when the file
|
||||
# was first included. Include it again to get the language info.
|
||||
# Remove this when all compiler info is removed from system files.
|
||||
if (NOT _INCLUDED_FILE)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||
endif ()
|
||||
|
||||
if(CMAKE_ObjectiveC_COMPILER_LINKS_STATICALLY)
|
||||
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
|
||||
endif()
|
||||
|
||||
# This should be included before the _INIT variables are
|
||||
# used to initialize the cache. Since the rule variables
|
||||
# have if blocks on them, users can still define them here.
|
||||
# But, it should still be after the platform file so changes can
|
||||
# be made to those values.
|
||||
|
||||
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||
# Save the full path of the file so try_compile can use it.
|
||||
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_USER_MAKE_RULES_OVERRIDE_ObjectiveC)
|
||||
# Save the full path of the file so try_compile can use it.
|
||||
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_ObjectiveC} RESULT_VARIABLE _override)
|
||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE_ObjectiveC "${_override}")
|
||||
endif()
|
||||
|
||||
|
||||
# for most systems a module is the same as a shared library
|
||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||
# copy the values from the LIBRARY variables
|
||||
if(NOT CMAKE_MODULE_EXISTS)
|
||||
set(CMAKE_SHARED_MODULE_ObjectiveC_FLAGS ${CMAKE_SHARED_LIBRARY_ObjectiveC_FLAGS})
|
||||
set(CMAKE_SHARED_MODULE_CREATE_ObjectiveC_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_ObjectiveC_FLAGS})
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
# default build type is none
|
||||
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
endif()
|
||||
set (CMAKE_ObjectiveC_FLAGS_DEBUG "${CMAKE_ObjectiveC_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during debug builds.")
|
||||
set (CMAKE_ObjectiveC_FLAGS_MINSIZEREL "${CMAKE_ObjectiveC_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during release builds for minimum size.")
|
||||
set (CMAKE_ObjectiveC_FLAGS_RELEASE "${CMAKE_ObjectiveC_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during release builds.")
|
||||
set (CMAKE_ObjectiveC_FLAGS_RELWITHDEBINFO "${CMAKE_ObjectiveC_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during release builds with debug info.")
|
||||
endif()
|
||||
|
||||
if(CMAKE_ObjectiveC_STANDARD_LIBRARIES_INIT)
|
||||
set(CMAKE_ObjectiveC_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
|
||||
CACHE STRING "Libraries linked by default with all C applications.")
|
||||
mark_as_advanced(CMAKE_ObjectiveC_STANDARD_LIBRARIES)
|
||||
endif()
|
||||
|
||||
include(CMakeCommonLanguageInclude)
|
||||
|
||||
# now define the following rule variables
|
||||
|
||||
# CMAKE_ObjectiveC_CREATE_SHARED_LIBRARY
|
||||
# CMAKE_ObjectiveC_CREATE_SHARED_MODULE
|
||||
# CMAKE_ObjectiveC_COMPILE_OBJECT
|
||||
# CMAKE_ObjectiveC_LINK_EXECUTABLE
|
||||
|
||||
# variables supplied by the generator at use time
|
||||
# <TARGET>
|
||||
# <TARGET_BASE> the target without the suffix
|
||||
# <OBJECTS>
|
||||
# <OBJECT>
|
||||
# <LINK_LIBRARIES>
|
||||
# <FLAGS>
|
||||
# <LINK_FLAGS>
|
||||
|
||||
# C compiler information
|
||||
# <CMAKE_ObjectiveC_COMPILER>
|
||||
# <CMAKE_SHARED_LIBRARY_CREATE_ObjectiveC_FLAGS>
|
||||
# <CMAKE_SHARED_MODULE_CREATE_ObjectiveC_FLAGS>
|
||||
# <CMAKE_ObjectiveC_LINK_FLAGS>
|
||||
|
||||
# Static library tools
|
||||
# <CMAKE_AR>
|
||||
# <CMAKE_RANLIB>
|
||||
|
||||
|
||||
# create a C shared library
|
||||
if(NOT CMAKE_ObjectiveC_CREATE_SHARED_LIBRARY)
|
||||
set(CMAKE_ObjectiveC_CREATE_SHARED_LIBRARY
|
||||
"<CMAKE_ObjectiveC_COMPILER> <CMAKE_SHARED_LIBRARY_ObjectiveC_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_ObjectiveC_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||
endif()
|
||||
|
||||
# create a C shared module just copy the shared library rule
|
||||
if(NOT CMAKE_ObjectiveC_CREATE_SHARED_MODULE)
|
||||
set(CMAKE_ObjectiveC_CREATE_SHARED_MODULE ${CMAKE_ObjectiveC_CREATE_SHARED_LIBRARY})
|
||||
endif()
|
||||
|
||||
# Create a static archive incrementally for large object file counts.
|
||||
# If CMAKE_ObjectiveC_CREATE_STATIObjectiveC_LIBRARY is set it will override these.
|
||||
if(NOT DEFINED CMAKE_ObjectiveC_ARCHIVE_CREATE)
|
||||
set(CMAKE_ObjectiveC_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_ObjectiveC_ARCHIVE_APPEND)
|
||||
set(CMAKE_ObjectiveC_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_ObjectiveC_ARCHIVE_FINISH)
|
||||
set(CMAKE_ObjectiveC_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||
endif()
|
||||
|
||||
set(CMAKE_INCLUDE_FLAG_ObjectiveC "-I")
|
||||
set(CMAKE_ObjectiveC_IMPLICIT_LINK_LIBRARIES objc)
|
||||
|
||||
# compile a C file into an object file
|
||||
if(NOT CMAKE_ObjectiveC_COMPILE_OBJECT)
|
||||
if("${CMAKE_VERSION}" VERSION_GREATER 3.3.2)
|
||||
set(CMAKE_ObjectiveC_COMPILE_OBJECT
|
||||
"<CMAKE_ObjectiveC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
else ()
|
||||
set(CMAKE_ObjectiveC_COMPILE_OBJECT
|
||||
"<CMAKE_ObjectiveC_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_ObjectiveC_LINK_EXECUTABLE)
|
||||
set(CMAKE_ObjectiveC_LINK_EXECUTABLE
|
||||
"<CMAKE_ObjectiveC_COMPILER> <FLAGS> <CMAKE_ObjectiveC_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_EXECUTABLE_RUNTIME_ObjectiveC_FLAG)
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_ObjectiveC_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ObjectiveC_FLAG})
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_EXECUTABLE_RUNTIME_ObjectiveC_FLAG_SEP)
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_ObjectiveC_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ObjectiveC_FLAG_SEP})
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ObjectiveC_FLAG)
|
||||
set(CMAKE_EXECUTABLE_RPATH_LINK_ObjectiveC_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ObjectiveC_FLAG})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
CMAKE_ObjectiveC_FLAGS
|
||||
CMAKE_ObjectiveC_FLAGS_DEBUG
|
||||
CMAKE_ObjectiveC_FLAGS_MINSIZEREL
|
||||
CMAKE_ObjectiveC_FLAGS_RELEASE
|
||||
CMAKE_ObjectiveC_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
set(CMAKE_ObjectiveC_INFORMATION_LOADED 1)
|
|
@ -1,64 +0,0 @@
|
|||
if(CMAKE_ObjectiveC_COMPILER_FORCED)
|
||||
# The compiler configuration was forced by the user.
|
||||
# Assume the user has configured all compiler information.
|
||||
set(CMAKE_ObjectiveC_COMPILER_WORKS TRUE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(CMakeTestCompilerCommon)
|
||||
|
||||
# Remove any cached result from an older CMake version.
|
||||
# We now store this in CMakeCCompiler.cmake.
|
||||
unset(CMAKE_ObjectiveC_COMPILER_WORKS CACHE)
|
||||
|
||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||
# determine that that selected C compiler can actually compile
|
||||
# and link the most basic of programs. If not, a fatal error
|
||||
# is set and cmake stops processing commands and will not generate
|
||||
# any makefiles or projects.
|
||||
if(NOT CMAKE_ObjectiveC_COMPILER_WORKS)
|
||||
PrintTestCompilerStatus("ObjectiveC" "")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testObjectiveCCompiler.m
|
||||
"#ifdef __cplusplus\n"
|
||||
"# error \"The CMAKE_ObjectiveC_COMPILER is set to an ObjectiveC++ compiler\"\n"
|
||||
"#endif\n"
|
||||
"@interface Foo\n"
|
||||
"@end\n"
|
||||
"int main(int argc, char* argv[])\n"
|
||||
"{ (void)argv; return argc-1;}\n")
|
||||
try_compile(CMAKE_ObjectiveC_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testObjectiveCCompiler.m
|
||||
OUTPUT_VARIABLE __CMAKE_ObjectiveC_COMPILER_OUTPUT)
|
||||
# Move result from cache to normal variable.
|
||||
set(CMAKE_ObjectiveC_COMPILER_WORKS ${CMAKE_ObjectiveC_COMPILER_WORKS})
|
||||
unset(CMAKE_ObjectiveC_COMPILER_WORKS CACHE)
|
||||
set(ObjectiveC_TEST_WAS_RUN 1)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_ObjectiveC_COMPILER_WORKS)
|
||||
PrintTestCompilerStatus("ObjectiveC" " -- broken")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the ObjectiveC compiler works failed with "
|
||||
"the following output:\n${__CMAKE_ObjectiveC_COMPILER_OUTPUT}\n\n")
|
||||
message(FATAL_ERROR "The ObjectiveC compiler \"${CMAKE_ObjectiveC_COMPILER}\" "
|
||||
"is not able to compile a simple test program.\nIt fails "
|
||||
"with the following output:\n ${__CMAKE_ObjectiveC_COMPILER_OUTPUT}\n\n"
|
||||
"CMake will not be able to correctly generate this project.")
|
||||
else()
|
||||
if(ObjectiveC_TEST_WAS_RUN)
|
||||
PrintTestCompilerStatus("ObjectiveC" " -- works")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the ObjectiveC compiler works passed with "
|
||||
"the following output:\n${__CMAKE_ObjectiveC_COMPILER_OUTPUT}\n\n")
|
||||
endif()
|
||||
|
||||
# Re-configure file
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_LIST_DIR}/CMakeObjectiveCCompiler.cmake.in
|
||||
${CMAKE_PLATFORM_INFO_DIR}/CMakeObjectiveCCompiler.cmake
|
||||
@ONLY
|
||||
)
|
||||
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeObjectiveCCompiler.cmake)
|
||||
endif()
|
||||
|
||||
unset(__CMAKE_ObjectiveC_COMPILER_OUTPUT)
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
option(LANG_CXX "Turn on C++ support" ON)
|
||||
option(LANG_OBJC "Turn on Objective-C support" OFF)
|
||||
|
||||
if (LANG_CXX)
|
||||
enable_language(CXX)
|
||||
if (CMAKE_CXX_COMPILER_WORKS)
|
||||
set(CXX_BRIDGE 1)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (LANG_OBJC)
|
||||
enable_language(ObjectiveC)
|
||||
if (CMAKE_ObjectiveC_COMPILER_WORKS)
|
||||
set(OBJC_BRIDGE 1)
|
||||
endif ()
|
||||
endif ()
|
|
@ -43,12 +43,13 @@ if (MSVC)
|
|||
include_directories(dependencies/wingetopt/src/)
|
||||
endif ()
|
||||
|
||||
# Language support
|
||||
|
||||
include(Languages)
|
||||
|
||||
# Check for C++11
|
||||
|
||||
option(LANG_CXX "Turn on C++ support" ON)
|
||||
if (LANG_CXX)
|
||||
enable_language(CXX)
|
||||
endif ()
|
||||
|
||||
if (NOT MSVC AND CMAKE_CXX_COMPILER_WORKS)
|
||||
include(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
|
@ -201,18 +202,6 @@ if (PCRE_FOUND)
|
|||
set(HAVE_PCRE 1)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_ObjectiveC_COMPILER_WORKS)
|
||||
set(CMAKE_ObjectiveC_FLAGS "${CMAKE_ObjectiveC_FLAGS} ${CMAKE_C_FLAGS} -fobjc-exceptions")
|
||||
if ("${CMAKE_ObjectiveC_COMPILER_ID}" STREQUAL "Clang" AND APPLE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Foundation")
|
||||
endif ()
|
||||
add_definitions(-D_NATIVE_OBJC_EXCEPTIONS)
|
||||
|
||||
if (NOT WIN32)
|
||||
set(CMAKE_ObjectiveC_FLAGS "${CMAKE_ObjectiveC_FLAGS} -fPIC")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(INTERFACE_FILES
|
||||
include/criterion/assert.h
|
||||
include/criterion/abort.h
|
||||
|
|
|
@ -7,13 +7,6 @@
|
|||
#cmakedefine MINGW_DEFINE_OFF_T @MINGW_DEFINE_OFF_T@
|
||||
#cmakedefine01 HAVE_STRTOK_S
|
||||
|
||||
#cmakedefine CXX_BRIDGE @CXX_BRIDGE@
|
||||
#cmakedefine OBJECTIVEC_BRIDGE @OBJECTIVEC_BRIDGE@
|
||||
|
||||
# ifdef OBJECTIVEC_BRIDGE
|
||||
# define OBJC_BRIDGE OBJECTIVEC_BRIDGE
|
||||
# endif
|
||||
|
||||
# define LOCALEDIR "${LOCALEDIR}"
|
||||
# define PACKAGE "${PROJECT_NAME}"
|
||||
# define VERSION "${PROJECT_VERSION}"
|
||||
|
|
Loading…
Add table
Reference in a new issue