From a58b6e9dba6d3c45b5a0e668cb7573f24a644fdc Mon Sep 17 00:00:00 2001 From: Ernesto Castellotti Date: Wed, 28 Aug 2019 16:50:45 +0200 Subject: [PATCH] Generate D interface file before other targets --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff7e2c9..165908e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,9 @@ file(GLOB EXAMPLE_SOURCES "examples/*.d") include_directories(include) set(CMAKE_D_FLAGS "${CMAKE_D_FLAGS} -betterC -O -release -L-rpath=.") -set_property(SOURCE ${PUB_SOURCES} PROPERTY COMPILE_FLAGS "-Hd=${CMAKE_SOURCE_DIR}/include") +add_library(generate_header SHARED ${PUB_SOURCES}) +target_compile_options (generate_header PRIVATE "-Hd=${CMAKE_SOURCE_DIR}/include") + add_library(${PROJECT_NAME} SHARED ${SOURCES}) add_executable(open-usbextreme-example ${EXAMPLE_SOURCES})