Skip to content

Commit

Permalink
Boost submodule & CMake Boost build
Browse files Browse the repository at this point in the history
  • Loading branch information
101001000 committed Feb 13, 2023
1 parent b53892b commit 7b20b5e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include
boost
CMakeFiles
lib
third-party
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "boost"]
path = boost
url = https://github.com/boostorg/boost.git
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.16)
set(FETCHCONTENT_QUIET FALSE)
set( CMAKE_CXX_STANDARD 17 )
include(FetchContent)

if(NOT SYCL_PATH)
Expand Down Expand Up @@ -30,11 +29,15 @@ endif()

message(STATUS "Setting up clang...")

# CMake won't detect Clang ABI for the intel's Clang implementation with the -fsycl tag, so some compile features need to be specified manually.
set(CMAKE_CXX_COMPILE_FEATURES cxx_constexpr cxx_std_11 cxx_alias_templates cxx_variadic_templates cxx_decltype)

set(CMAKE_CXX_COMPILER "${SYCL_PATH}/build/bin/clang++.exe" CACHE INTERNAL "C++ compiler" FORCE)
set(CMAKE_CXX_FLAGS "-W#pragma-messages -Wno-unknown-cuda-version -Wno-enum-constexpr-conversion -Wno-linker-warnings -Wno-macro-redefined -fsycl -fsycl-targets=nvptx64-nvidia-cuda")
set(CMAKE_CXX_FLAGS "-fsycl -fsycl-targets=nvptx64-nvidia-cuda")
set(CMAKE_CXX_COMPILER_WORKS 1)

set(CMAKE_C_COMPILER "${SYCL_PATH}/build/bin/clang.exe" CACHE INTERNAL "C compiler" FORCE)
#set(CMAKE_C_FLAGS "-fsycl -fsycl-targets=nvptx64-nvidia-cuda")
set(CMAKE_C_COMPILER_WORKS 1)

project(ElevenRender)
Expand All @@ -50,11 +53,16 @@ find_package(Git REQUIRED)

message(STATUS "Setting up Boost...")

set(Boost_COMPILER "-clangw15")



#set(BOOST_ENABLE_CMAKE ON)
find_package(Boost 1.79.0 COMPONENTS program_options json log REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
#find_package(Boost 1.79.0 COMPONENTS program_options json log REQUIRED)
#include_directories(${Boost_INCLUDE_DIRS})

#set(BOOST_ALL_NO_LIB)
set(BOOST_INCLUDE_LIBRARIES program_options json log)
add_subdirectory(boost EXCLUDE_FROM_ALL)

message(STATUS "Getting RapidObj")
message(STATUS ${Boost_INCLUDE_DIRS})
Expand Down Expand Up @@ -116,7 +124,8 @@ add_executable(ElevenRender ${SOURCES} ${LAN_SOURCES} build/_deps/mikktspace-src

#target_link_libraries(ElevenRender PUBLIC Boost::program_options Boost::json Boost::log Boost::asio)

target_link_libraries(ElevenRender ${Boost_LIBRARIES})
#target_link_libraries(ElevenRender ${Boost_LIBRARIES})
target_link_libraries(ElevenRender Boost::program_options Boost::json Boost::log_setup Boost::log Boost::asio)
target_link_libraries(ElevenRender _deps/oidnzip-src/oidn-1.4.3.x64.vc14.windows/lib/OpenImageDenoise)
target_link_libraries(ElevenRender _deps/oidnzip-src/oidn-1.4.3.x64.vc14.windows/lib/tbb)
target_link_libraries(ElevenRender sycl)
1 change: 1 addition & 0 deletions boost
Submodule boost added at 58b99a
5 changes: 4 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@setlocal enableextensions
@cd /d "%~dp0"

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
mkdir build
cd build
cmake -G "Ninja" -D CMAKE_BUILD_TYPE=Release ..\
cmake -G "Ninja" -D CMAKE_BUILD_TYPE=Release -DBOOST_ALL_NO_LIB=ON ..\
ninja
copy _deps\sycl_llvm-src\build\bin\sycl.dll .\bin\
copy _deps\oidnzip-src\oidn-1.4.3.x64.vc14.windows\bin\OpenImageDenoise.dll .\bin\
Expand Down
1 change: 1 addition & 0 deletions src/Logging.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#define BOOST_ALL_NO_LIB
#define _WIN32_WINNT 0x0601

#include <boost/log/trivial.hpp>
Expand Down

0 comments on commit 7b20b5e

Please sign in to comment.