diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 70 |
1 files changed, 17 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 083ea96d..6a25d5b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,12 +10,6 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -if(CMAKE_BUILD_TYPE STREQUAL "release") - set (BUILD_FLAVOR "release") -else(CMAKE_BUILD_TYPE STREQUAL "release") - set (BUILD_FLAVOR "debug") -endif(CMAKE_BUILD_TYPE STREQUAL "release") - add_definitions(-DCL_TARGET_OPENCL_VERSION=300) add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_2_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_1_APIS=1) @@ -29,14 +23,6 @@ if(USE_CL_EXPERIMENTAL) add_definitions(-DCL_EXPERIMENTAL) endif(USE_CL_EXPERIMENTAL) -# Support both VS2008 and VS2012. -set(BUILD_DIR "$ENV{ADRENO_DRIVER}/build") -if(MSVC90) - set(VS_BUILD_DIR "${BUILD_DIR}/vs2008") -else(MSVC110) - set(VS_BUILD_DIR "${BUILD_DIR}/vs2012") -endif(MSVC90) - #----------------------------------------------------------- # Default Configurable Test Set #----------------------------------------------------------- @@ -102,14 +88,14 @@ macro(add_cxx_flag_if_supported flag) endmacro(add_cxx_flag_if_supported) if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang") + add_cxx_flag_if_supported(-Wmisleading-indentation) + add_cxx_flag_if_supported(-Wunused-variable) add_cxx_flag_if_supported(-Wno-narrowing) add_cxx_flag_if_supported(-Wno-format) add_cxx_flag_if_supported(-Werror) add_cxx_flag_if_supported(-Wno-error=cpp) # Allow #warning directive - add_cxx_flag_if_supported(-Wno-error=absolute-value) # Issue 783 add_cxx_flag_if_supported(-Wno-error=unknown-pragmas) # Issue #785 add_cxx_flag_if_supported(-Wno-error=asm-operand-widths) # Issue #784 - add_cxx_flag_if_supported(-Wno-error=overflow) # Fixed by #699 # -msse -mfpmath=sse to force gcc to use sse for float math, # avoiding excess precision problems that cause tests like int2float @@ -127,9 +113,24 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D__SSE__") endif() +# Set a module's COMPILE_FLAGS if using gcc or clang. +macro(set_gnulike_module_compile_flags flags) + if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang") + SET_SOURCE_FILES_PROPERTIES( + ${${MODULE_NAME}_SOURCES} + PROPERTIES + COMPILE_FLAGS ${flags} + ) + endif() +endmacro(set_gnulike_module_compile_flags) + if(MSVC) # Don't warn when using standard non-secure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + # Don't warn about using the portable "strdup" function. + add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) + # Fix std::min and std::max handling with windows.harness. + add_compile_definitions(NOMINMAX) endif() if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" ) @@ -152,10 +153,6 @@ if(LINK_PTHREAD) list(APPEND CLConform_LIBRARIES pthread) endif() -if(DEFINED USE_GLES3) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLES3") -endif() - if(APPLE) find_library(corefoundation CoreFoundation) find_library(iokit IOKit) @@ -169,38 +166,5 @@ include_directories(${CLConform_SOURCE_DIR}/test_common/harness ${CLConform_SOURCE_DIR}/test_common/gl ${CLConform_SOURCE_DIR}/test_common) -if(CMAKE_BUILD_TYPE STREQUAL "release") - set (BUILD_FLAVOR "release") -elseif (CMAKE_BUILD_TYPE STREQUAL "debug") - set (BUILD_FLAVOR "debug") -endif(CMAKE_BUILD_TYPE STREQUAL "release") - - add_subdirectory(test_common) add_subdirectory(test_conformance) - -# Support both VS2008 and VS2012. -set (DLL_FILES "${VS_BUILD_DIR}/Debug/*.dll") -set (DST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/") - -if (WIN32) - set (COPY "echo") - add_custom_target(COPY_DLL${CONFORMANCE_SUFFIX} ALL - COMMAND ${COPY} "${DLL_FILES}" "${DST_DIR}" - COMMENT "Copying dll files.. ") -else (WIN32) - set (COPY cp) - add_custom_target(COPY_DLL${CONFORMANCE_SUFFIX}) -endif(WIN32) - -set_property(TARGET COPY_DLL${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") - -if(WIN32) - add_custom_target( COPY_FILES${CONFORMANCE_SUFFIX} ALL - COMMAND ${COPY} ${DLL_FILES} ${DST_DIR} - COMMENT "Copying other files to output folder..." ) -else(WIN32) - add_custom_target( COPY_FILES${CONFORMANCE_SUFFIX} ) -endif(WIN32) - -set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") |