diff --git a/CMakeLists.txt b/CMakeLists.txt index 725a6418..cf087cfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ set(LK_SRC # ##################################################################################################################### -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 20) if (MSVC) add_compile_options(/W3 /wd4996 /MP) @@ -57,7 +57,6 @@ if (MSVC) set(${flag_var} "${${flag_var}} /D_DEBUG" CACHE STRING "compile flags" FORCE) endforeach () else (MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (APPLE) add_compile_options( -fno-common) @@ -82,17 +81,53 @@ endif (MSVC) if (UNIX) if(EXISTS /usr/local/bin/wx-config-3) set(wxWidgets_CONFIG_EXECUTABLE /usr/local/bin/wx-config-3) - find_package(wxWidgets REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base) + find_package(wxWidgets QUIET REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base) else () set(wxWidgets_CONFIG_EXECUTABLE $ENV{WXMSW3}/bin/wx-config) - find_package(wxWidgets REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base) + find_package(wxWidgets QUIET REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base) endif () else () +# set(wxWidgets_ROOT_DIR $ENV{WXMSW3}) +# find_package(wxWidgets REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base scintilla) + set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Debug and Release Builds Configured" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20") + # for linking to Release build of ortools + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") + # Get the current debug flags and remove the /D_DEBUG option. + string(REPLACE "/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + # following does not force release libraries for wxWidgets using find_package + #set(CMAKE_MAP_IMPORTED_CONFIG_DEBUG RELEASE) + set(wxWidgets_ROOT_DIR $ENV{WXMSW3}) - find_package(wxWidgets REQUIRED qa webview aui richtext html propgrid adv net stc core base scintilla) + find_package(wxWidgets QUIET REQUIRED xrc webview stc richtext ribbon propgrid aui gl html qa adv core xml net base scintilla) + + # message("All wxWidgets: " ${wxWidgets_LIBRARIES}) + set(FOUND "false") + foreach(lib ${wxWidgets_LIBRARIES}) + string(FIND ${lib} "optimized" INDEX) + string(FIND ${lib} "debug" INDEX2) + string(FIND ${lib} "wxWidgets" INDEX3) + if (INDEX GREATER_EQUAL 0) # skip once + set(FOUND "true") + continue() + elseif((INDEX2 LESS 0) AND (INDEX3 LESS 0)) + set(FOUND "true") + endif() + if (${FOUND} STREQUAL "true") + set(FOUND "false") + message("lib: ${lib}") + list(APPEND WX_LIBS_LIST ${lib}) + endif() + endforeach() + + list(JOIN WX_LIBS_LIST ";" wxWidgets_LIBRARIES) + # message("Link Libraries for wxWidgets: ${wxWidgets_LIBRARIES}") + endif () -include(${wxWidgets_USE_FILE}) +if (wxWidgets_FOUND) + include(${wxWidgets_USE_FILE}) +endif () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}") @@ -151,5 +186,28 @@ if (NOT SAM_SKIP_TOOLS) target_link_libraries(lk_sandbox -ldl) endif () - target_link_libraries(lk_sandbox lk ${wxWidgets_LIBRARIES}) +# target_link_libraries(lk_sandbox ${wxWidgets_LIBRARIES}) +# message("All wxWidgets: " ${wxWidgets_LIBRARIES}) + set(FOUND "false") + foreach(lib ${wxWidgets_LIBRARIES}) + string(FIND ${lib} "optimized" INDEX) + string(FIND ${lib} "debug" INDEX2) + string(FIND ${lib} "wxWidgets" INDEX3) + if (INDEX GREATER_EQUAL 0) # skip once + set(FOUND "true") + continue() + elseif((INDEX2 LESS 0) AND (INDEX3 LESS 0)) + set(FOUND "true") + endif() + if (${FOUND} STREQUAL "true") + set(FOUND "false") +# message("lib: ${lib}") + list(APPEND WX_LIBS_LIST ${lib}) + endif() + endforeach() + + list(JOIN WX_LIBS_LIST ";" WX_LIBS) +# message("Link Libraries for lk_sandbox: ${WX_LIBS}") + target_link_libraries(lk_sandbox lk ${WX_LIBS}) + endif() diff --git a/LICENSE b/LICENSE index c6f2b345..7857d8d8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2017, 2022 Alliance for Sustainable Energy, LLC +Copyright (c) 2017, 2022 Alliance for Energy Innovation, LLC All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 515e4812..14aff44b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # LK [](https://opensource.org/licenses/BSD-3-Clause) -LK is a scripting language originally developed for the National Renewable Energy Laboratory's [System Advisor Model™ (SAM™)](https://sam.nrel.gov). LK is designed to be small, fast, and easily embedded in other applications, and provides a way for users to to extend an application's built-in functionality. +LK is a scripting language originally developed for the National Laboratory of the Rockies' [System Advisor Model™ (SAM™)](https://sam.nrel.gov). LK is designed to be small, fast, and easily embedded in other applications, and provides a way for users to to extend an application's built-in functionality. This repository contains a cross-platform standard library of function calls and core LK engine, which includes a lexical analyzer, parser, compiler, and virtual machine. It comprises roughly 7000 lines of ISO-standard C++ code, and is only dependent on the Standard C++ Library (STL), making LK extremely tight and portable to various platforms. LK also provides a C language API for writing extensions that can be dynamically loaded at runtime. diff --git a/doc/html/absyn_8h_source.html b/doc/html/absyn_8h_source.html index b563ee88..9ccba6f4 100644 --- a/doc/html/absyn_8h_source.html +++ b/doc/html/absyn_8h_source.html @@ -89,7 +89,7 @@
LK, Copyright (c) 2008-2017, Alliance for Sustainable Energy, LLC. All rights reserved.
+LK, Copyright (c) 2008-2017, Alliance for Energy Innovation, LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
diff --git a/doc/html/parse_8h_source.html b/doc/html/parse_8h_source.html index 4c7ec2bc..f9bb6fb7 100644 --- a/doc/html/parse_8h_source.html +++ b/doc/html/parse_8h_source.html @@ -89,7 +89,7 @@