diff --git a/CMakeLists.txt b/CMakeLists.txt index 668cd7e..365f2f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}") # Compiler check (needs -std:c++11 flag) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) -if(COMPILER_SUPPORTS_CXX11) +if(TRUE) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake/OptimalOptions.cmake b/cmake/OptimalOptions.cmake index e4d5c56..5d391cb 100644 --- a/cmake/OptimalOptions.cmake +++ b/cmake/OptimalOptions.cmake @@ -11,11 +11,11 @@ IF(MSVC) # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /fp:fast") # Optimization flags. - SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL") - SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL") - SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") - SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG") - SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG") + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /O2 /Ob2 /Oi /Ot /Oy") + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Ob2 /Oi /Ot /Oy") +# SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") +# SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG") +# SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG") # Definitions. ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__) diff --git a/extern/CMP_Core/source/cmp_math_func.h b/extern/CMP_Core/source/cmp_math_func.h index c2f8908..b652497 100644 --- a/extern/CMP_Core/source/cmp_math_func.h +++ b/extern/CMP_Core/source/cmp_math_func.h @@ -32,6 +32,7 @@ // Core API which have have GPU equivalents, defined here for HPC_CPU usage //============================================================================ +#include #include using namespace std; diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index ca90fa0..d8fbe1c 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -5,7 +5,7 @@ ADD_SUBDIRECTORY(EtcLib) ADD_SUBDIRECTORY(rg_etc1_v104) #ADD_SUBDIRECTORY(etcpack) -ADD_SUBDIRECTORY(libsquish-1.15) +#ADD_SUBDIRECTORY(libsquish-1.15) ADD_SUBDIRECTORY(CMP_Core) diff --git a/src/bc6h/CMakeLists.txt b/src/bc6h/CMakeLists.txt index fd75e74..bba50d5 100644 --- a/src/bc6h/CMakeLists.txt +++ b/src/bc6h/CMakeLists.txt @@ -15,3 +15,8 @@ SET(BC6H_SRCS ADD_LIBRARY(bc6h STATIC ${BC6H_SRCS}) TARGET_LINK_LIBRARIES(bc6h nvcore nvmath) + +INSTALL(TARGETS bc6h + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) diff --git a/src/bc7/CMakeLists.txt b/src/bc7/CMakeLists.txt index 566fe1f..10b37cc 100644 --- a/src/bc7/CMakeLists.txt +++ b/src/bc7/CMakeLists.txt @@ -23,3 +23,8 @@ SET(BC7_SRCS ADD_LIBRARY(bc7 STATIC ${BC7_SRCS}) TARGET_LINK_LIBRARIES(bc7 nvcore nvmath) + +INSTALL(TARGETS bc7 + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) diff --git a/src/nvmath/nvmath.h b/src/nvmath/nvmath.h index 38532eb..e68d8f8 100644 --- a/src/nvmath/nvmath.h +++ b/src/nvmath/nvmath.h @@ -118,12 +118,12 @@ inline float asinf_assert(const float f) #endif #if NV_CC_MSVC -NV_FORCEINLINE float log2f(float x) +NV_FORCEINLINE float nv_log2f(float x) { nvCheck(x >= 0); return logf(x) / logf(2.0f); } -NV_FORCEINLINE float exp2f(float x) +NV_FORCEINLINE float nv_exp2f(float x) { return powf(2.0f, x); } diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt index 8285f99..16500ca 100644 --- a/src/nvtt/CMakeLists.txt +++ b/src/nvtt/CMakeLists.txt @@ -47,9 +47,15 @@ ADD_DEFINITIONS(-DNVTT_EXPORTS) #ADD_DEFINITIONS(-DHAVE_RGETC) #ADD_DEFINITIONS(-DHAVE_ETCPACK) +if(APPLE) + add_compile_options(-mbmi2 -mfma) +endif() + IF(NVTT_SHARED) + ADD_DEFINITIONS(-DNVTT_SHARED=1) ADD_LIBRARY(nvtt SHARED ${NVTT_SRCS}) ELSE(NVTT_SHARED) + ADD_DEFINITIONS(-DNVTT_SHARED=0) ADD_LIBRARY(nvtt ${NVTT_SRCS}) ENDIF(NVTT_SHARED) @@ -64,4 +70,4 @@ INSTALL(FILES nvtt.h nvtt_wrapper.h DESTINATION include/nvtt) ADD_SUBDIRECTORY(tools) -ADD_SUBDIRECTORY(tests) +#ADD_SUBDIRECTORY(tests) diff --git a/src/nvtt/squish/CMakeLists.txt b/src/nvtt/squish/CMakeLists.txt index 65a5dd3..1ee51e3 100644 --- a/src/nvtt/squish/CMakeLists.txt +++ b/src/nvtt/squish/CMakeLists.txt @@ -21,3 +21,8 @@ SET(SQUISH_SRCS simd_ve.h) ADD_LIBRARY(nvsquish STATIC ${SQUISH_SRCS}) + +INSTALL(TARGETS nvsquish + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static)