From 075d88e8d7abb5e0bc8fc4b0f5f1853487362e19 Mon Sep 17 00:00:00 2001 From: milek Date: Mon, 25 Mar 2019 20:35:23 +0000 Subject: [PATCH] fix stdafx cotire --- CMakeLists.txt | 13 +++++-------- PyInt.cpp | 3 ++- stdafx.h | 7 +------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 315ef838..c9720c07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.0) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake_modules/") -#include(PrecompiledHeader) include(cotire) set(DEPS_DIR ${DEPS_DIR} "${CMAKE_SOURCE_DIR}/ref") project("eu07") @@ -165,11 +164,6 @@ endif() add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) -set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h") -set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) -cotire(${PROJECT_NAME}) -#add_precompiled_header(${PROJECT_NAME} stdafx.h FORCEINCLUDE SOURCE_CXX stdafx.cpp) - if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) # /wd4996: disable "deprecation" warnings # /wd4244: disable warnings for conversion with possible loss of data @@ -198,8 +192,7 @@ include_directories(${OPENGL_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES}) find_package(GLEW REQUIRED) -include_directories(${GLEW_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} ${GLEW_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} GLEW::GLEW) find_package(GLFW3 REQUIRED) include_directories(${GLFW3_INCLUDE_DIR}) @@ -239,3 +232,7 @@ endif() if (WIN32) target_link_libraries(${PROJECT_NAME} ws2_32) endif() + +set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h") +set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) +cotire(${PROJECT_NAME}) diff --git a/PyInt.cpp b/PyInt.cpp index f4f2ae4b..74d4d6e7 100644 --- a/PyInt.cpp +++ b/PyInt.cpp @@ -154,7 +154,8 @@ void python_taskqueue::exit() { m_condition.notify_all(); // let them free up their shit before we proceed for( auto &worker : m_workers ) { - worker.join(); + if (worker.joinable()) + worker.join(); } // get rid of the leftover tasks // with the workers dead we don't have to worry about concurrent access anymore diff --git a/stdafx.h b/stdafx.h index 8b968ab0..00b99763 100644 --- a/stdafx.h +++ b/stdafx.h @@ -81,12 +81,7 @@ #define GLFW_DLL #endif // _windows #endif // build_static -#ifndef __ANDROID__ -#include "GL/glew.h" -#else -#include -#include -#endif +#include #ifdef _WIN32 #include "GL/wglew.h" #endif