<commit_before>#
#  nanogi - A small reference GI renderer
# 
#  Copyright (c) 2015 Light Transport Entertainment Inc.
#  All rights reserved.
# 
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are met:
#  * Redistributions of source code must retain the above copyright
#  notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright
#  notice, this list of conditions and the following disclaimer in the
#  documentation and/or other materials provided with the distribution.
#  * Neither the name of the <organization> nor the
#  names of its contributors may be used to endorse or promote products
#  derived from this software without specific prior written permission.
# 
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#  DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
#  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
#  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

cmake_minimum_required(VERSION 3.0)

include(CMakeParseArguments)

project(nanogi)

# --------------------------------------------------------------------------------

##
## Module path, prefix, architecture, build type
##

# Add module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

if (MSVC)
	# Set prefix path according to generator
	# Currently only VC12 is supported
	if (CMAKE_GENERATOR STREQUAL "Visual Studio 12 2013 Win64")
		set(GENERATOR_PREFIX "vc12")
	else()
		message(FATAL_ERROR "Invalid generator")
	endif()
	list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external")
	list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/${GENERATOR_PREFIX}")
endif()

# Set architecture
if (CMAKE_CL_64)
	set(CMAKE_LIBRARY_ARCHITECTURE "x64")
else()
	set(CMAKE_LIBRARY_ARCHITECTURE "i386")
endif()

# Set Release as the default build mode
if (NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE "Release" CACHE STRING
		"Choose build type (Debug, Release, RelWithDebInfo, or MinSizeRel)" FORCED)
endif()

# --------------------------------------------------------------------------------

##
## External libraries
##

# Boost
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
add_definitions(-DBOOST_ALL_NO_LIB)
find_package(Boost 1.54 REQUIRED COMPONENTS program_options filesystem system regex coroutine context)
include_directories(${Boost_INCLUDE_DIRS})

# GLM
find_package(GLM REQUIRED)
include_directories(${GLM_INCLUDE_DIRS})

if (MSVC)
	# Qt
	list(APPEND CMAKE_PREFIX_PATH $ENV{QTDIR})
	list(APPEND CMAKE_LIBRARY_PATH "C:\\Program Files (x86)\\Windows Kits\\8.0\\Lib\\win8\\um\\x64")
	set(CMAKE_INCLUDE_CURRENT_DIR ON)
	find_package(Qt5Widgets REQUIRED)
	find_package(Qt5UiTools REQUIRED)
	find_package(Qt5Gui REQUIRED)
	set(QT_BINARY_FILES_RELEASE "icudt53" "icuin53" "icuuc53" "Qt5Core" "Qt5Gui" "Qt5Widgets")
	set(QT_BINARY_FILES_DEBUG   "icudt53" "icuin53" "icuuc53" "Qt5Cored" "Qt5Guid" "Qt5Widgetsd")

	# GLEW
	set(GLEW_USE_STATIC_LIBS ON)
	find_package(GLEW)
	if (GLEW_FOUND)
		include_directories(${GLEW_INCLUDE_DIRS})
		add_definitions(${GLEW_DEFINITIONS})
	endif()
endif()

# Assimp
find_package(Assimp REQUIRED)
include_directories(${ASSIMP_INCLUDE_DIRS})

# FreeImage
find_package(FreeImage REQUIRED)
include_directories(${FREEIMAGE_INCLUDE_DIRS})

# Embree
find_package(Embree REQUIRED)
include_directories(${EMBREE_INCLUDE_DIRS})

# yaml-cpp
find_package(YamlCpp REQUIRED)
include_directories(${YAMLCPP_INCLUDE_DIRS})

# ctemplate
find_package(CTemplate REQUIRED)
add_definitions(-DCTEMPLATE_DLL_DECL=)           # Use static library
include_directories(${CTEMPLATE_INCLUDE_DIRS})

# TBB
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})

# Eigen3
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIRS})

# Add the binary directory to the include directories for generated headers
include_directories(${PROJECT_BINARY_DIR})

# --------------------------------------------------------------------------------

##
## Compiler options
##

if (MSVC)
	# Ignore linker warnings in VS
	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099")
	add_definitions(-D_SCL_SECURE_NO_WARNINGS)

	# Increase stack size to 10MB
	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")

	# Warning level 4, treat warning as errors
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX")

	# Add floating-point flag
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")

    # Platform flag (used in boost)
    # cf. http://stackoverflow.com/questions/9742003/platform-detection-in-cmake
    set(_VERSION ${CMAKE_SYSTEM_VERSION})
    string(REPLACE "." "" _VERSION ${_VERSION})
    string(REGEX REPLACE "([0-9])" "0\\1" _VERSION ${_VERSION})
    add_definitions(-D_WIN32_WINNT=0x${_VERSION})
endif()
<commit_msg>Remove /WX compile option<commit_after>#
#  nanogi - A small reference GI renderer
# 
#  Copyright (c) 2015 Light Transport Entertainment Inc.
#  All rights reserved.
# 
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are met:
#  * Redistributions of source code must retain the above copyright
#  notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright
#  notice, this list of conditions and the following disclaimer in the
#  documentation and/or other materials provided with the distribution.
#  * Neither the name of the <organization> nor the
#  names of its contributors may be used to endorse or promote products
#  derived from this software without specific prior written permission.
# 
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#  DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
#  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
#  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

cmake_minimum_required(VERSION 3.0)

include(CMakeParseArguments)

project(nanogi)

# --------------------------------------------------------------------------------

##
## Module path, prefix, architecture, build type
##

# Add module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

if (MSVC)
	# Set prefix path according to generator
	# Currently only VC12 is supported
	if (CMAKE_GENERATOR STREQUAL "Visual Studio 12 2013 Win64")
		set(GENERATOR_PREFIX "vc12")
	else()
		message(FATAL_ERROR "Invalid generator")
	endif()
	list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external")
	list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/${GENERATOR_PREFIX}")
endif()

# Set architecture
if (CMAKE_CL_64)
	set(CMAKE_LIBRARY_ARCHITECTURE "x64")
else()
	set(CMAKE_LIBRARY_ARCHITECTURE "i386")
endif()

# Set Release as the default build mode
if (NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE "Release" CACHE STRING
		"Choose build type (Debug, Release, RelWithDebInfo, or MinSizeRel)" FORCED)
endif()

# --------------------------------------------------------------------------------

##
## External libraries
##

# Boost
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
add_definitions(-DBOOST_ALL_NO_LIB)
find_package(Boost 1.54 REQUIRED COMPONENTS program_options filesystem system regex coroutine context)
include_directories(${Boost_INCLUDE_DIRS})

# GLM
find_package(GLM REQUIRED)
include_directories(${GLM_INCLUDE_DIRS})

if (MSVC)
	# Qt
	list(APPEND CMAKE_PREFIX_PATH $ENV{QTDIR})
	list(APPEND CMAKE_LIBRARY_PATH "C:\\Program Files (x86)\\Windows Kits\\8.0\\Lib\\win8\\um\\x64")
	set(CMAKE_INCLUDE_CURRENT_DIR ON)
	find_package(Qt5Widgets REQUIRED)
	find_package(Qt5UiTools REQUIRED)
	find_package(Qt5Gui REQUIRED)
	set(QT_BINARY_FILES_RELEASE "icudt53" "icuin53" "icuuc53" "Qt5Core" "Qt5Gui" "Qt5Widgets")
	set(QT_BINARY_FILES_DEBUG   "icudt53" "icuin53" "icuuc53" "Qt5Cored" "Qt5Guid" "Qt5Widgetsd")

	# GLEW
	set(GLEW_USE_STATIC_LIBS ON)
	find_package(GLEW)
	if (GLEW_FOUND)
		include_directories(${GLEW_INCLUDE_DIRS})
		add_definitions(${GLEW_DEFINITIONS})
	endif()
endif()

# Assimp
find_package(Assimp REQUIRED)
include_directories(${ASSIMP_INCLUDE_DIRS})

# FreeImage
find_package(FreeImage REQUIRED)
include_directories(${FREEIMAGE_INCLUDE_DIRS})

# Embree
find_package(Embree REQUIRED)
include_directories(${EMBREE_INCLUDE_DIRS})

# yaml-cpp
find_package(YamlCpp REQUIRED)
include_directories(${YAMLCPP_INCLUDE_DIRS})

# ctemplate
find_package(CTemplate REQUIRED)
add_definitions(-DCTEMPLATE_DLL_DECL=)           # Use static library
include_directories(${CTEMPLATE_INCLUDE_DIRS})

# TBB
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})

# Eigen3
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIRS})

# Add the binary directory to the include directories for generated headers
include_directories(${PROJECT_BINARY_DIR})

# --------------------------------------------------------------------------------

##
## Compiler options
##

if (MSVC)
	# Ignore linker warnings in VS
	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099")
	add_definitions(-D_SCL_SECURE_NO_WARNINGS)

	# Increase stack size to 10MB
	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")

	# Warning level 4, treat warning as errors
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")

	# Add floating-point flag
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")

    # Platform flag (used in boost)
    # cf. http://stackoverflow.com/questions/9742003/platform-detection-in-cmake
    set(_VERSION ${CMAKE_SYSTEM_VERSION})
    string(REPLACE "." "" _VERSION ${_VERSION})
    string(REGEX REPLACE "([0-9])" "0\\1" _VERSION ${_VERSION})
    add_definitions(-D_WIN32_WINNT=0x${_VERSION})
endif()

{'fraction_non_alphanumeric': 0.13053697342252757, 'fraction_numerical': 0.016091122762610738, 'mean_word_length': 4.584553255931348, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5765714', 'n_tokens_mistral': 3961, 'n_tokens_neox': 3552, 'n_words': 972}