cotire icon indicating copy to clipboard operation
cotire copied to clipboard

unity target fails to build with custom prefix header and excluded source file

Open onqtam opened this issue 9 years ago • 0 comments

The unity target for the game executable fails to build but the original target succeeds (cotire 1.7.6):

#CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
project(game)
include(cotire.cmake)
add_executable(${PROJECT_NAME} a.cc b.cc c.cc pch.h)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "pch.h")
set_source_files_properties(b.cc PROPERTIES COTIRE_EXCLUDED TRUE)
cotire(${PROJECT_NAME})
//pch.h
#pragma once
#include <vector>
//a.cc
int main() { return 5; }
//b.cc
void b() { std::vector<int> b; }
//c.cc
void c() { std::vector<int> c; }

This is a follow-up issue of #68 and I hope it would be easy to fix - to just use the precompiled header for the excluded from unity files too.

onqtam avatar Feb 10 '16 12:02 onqtam