From d516bb81caccb74a44abed908374e990d3dac9a4 Mon Sep 17 00:00:00 2001 From: JessyDL Date: Sat, 20 May 2023 13:37:50 +0300 Subject: [PATCH] fixed build issue on clang --- extern/CMakeLists.txt | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 49168e7e..18243fa0 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -35,22 +35,10 @@ endif() set_property(TARGET strtype PROPERTY FOLDER "extern") # setup cppfront which lacks a cmake integration -add_executable(cppfront_compiler cppfront/source/cppfront.cpp) -set_target_properties( - cppfront_compiler - PROPERTIES - OUTPUT_NAME cppfront - EXPORT_NAME cppfront -) -target_compile_features(cppfront_compiler PRIVATE cxx_std_20) - -add_library(cppfront_interface INTERFACE) -target_compile_features(cppfront_interface INTERFACE cxx_std_20) -target_sources( - cppfront_interface - INTERFACE - FILE_SET HEADERS - BASE_DIRS cppfront/include - FILES cppfront/include/cpp2util.h -) +add_executable(cppfront_compiler "${CMAKE_CURRENT_SOURCE_DIR}/cppfront/source/cppfront.cpp") +target_include_directories(cppfront_compiler PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/cppfront/source") +set_target_properties(cppfront_compiler PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED TRUE OUTPUT_NAME cppfront EXPORT_NAME cppfront) + +add_library(cppfront_interface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/cppfront/include/cpp2util.h") +set_target_properties(cppfront_interface PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED TRUE) target_include_directories(cppfront_interface SYSTEM INTERFACE "$")